Skip to content

Commit 15c709e

Browse files
committed
Raise a ValueError in _get_ordered_vertices() with "mixed" core dim order
1 parent 70be853 commit 15c709e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cf_xarray/helpers.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,12 @@ def _get_ordered_vertices(
338338
elif order == "descending":
339339
endpoints = np.maximum(bounds[..., :, 0], bounds[..., :, 1])
340340
last_endpoint = np.minimum(bounds[..., -1, 0], bounds[..., -1, 1])
341+
elif order == "mixed":
342+
raise ValueError(
343+
"Cannot determine vertices for non-monotonic bounds with mixed core "
344+
"dimension orders. Try normalizing the coordinates to a monotonic "
345+
"convention and try again."
346+
)
341347

342348
vertices = np.concatenate(
343349
[endpoints, np.expand_dims(last_endpoint, axis=-1)], axis=-1

0 commit comments

Comments
 (0)