Skip to content

Commit 9c287cf

Browse files
committed
Replace ValueError with NotImplementedError
1 parent 15c709e commit 9c287cf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

cf_xarray/helpers.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -327,20 +327,20 @@ def _get_ordered_vertices(
327327
np.ndarray
328328
Array of vertices with shape (..., N+1) or (N+1,).
329329
"""
330-
order = _get_order_of_core_dims(core_dim_orders)
331-
332330
if _is_bounds_monotonic(bounds):
333331
vertices = np.concatenate((bounds[..., :, 0], bounds[..., -1:, 1]), axis=-1)
334332
else:
333+
order = _get_order_of_core_dims(core_dim_orders)
334+
335335
if order == "ascending":
336336
endpoints = np.minimum(bounds[..., :, 0], bounds[..., :, 1])
337337
last_endpoint = np.maximum(bounds[..., -1, 0], bounds[..., -1, 1])
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 "
341+
else:
342+
raise NotImplementedError(
343+
f"Cannot determine vertices for non-monotonic bounds with '{order}' core "
344344
"dimension orders. Try normalizing the coordinates to a monotonic "
345345
"convention and try again."
346346
)

0 commit comments

Comments
 (0)