Skip to content

Commit ce274fc

Browse files
committed
ENH: Turn off spatial reordering when aggregating #432
A warning is raised when spatial_reorder=True and aggregate=True indicating spatial reordering is not done.
1 parent 857a0c9 commit ce274fc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/ocgis/api/subset.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,11 @@ def _process_subsettables_(self, rds):
235235
# Ensure coordinate are ordered in ascending order if requested. Note this will remove
236236
# bounds/corners.
237237
if self.ops.spatial_reorder:
238-
_update_longitude_order_(self, field_object)
238+
if self.ops.aggregate:
239+
msg = 'Spatial reordering not applicable for spatial aggregations. Reordering not executed.'
240+
ocgis_lh(msg=msg, level=logging.WARN, logger=self._subset_log)
241+
else:
242+
_update_longitude_order_(self, field_object)
239243

240244
field[ii] = field_object
241245

0 commit comments

Comments
 (0)