Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions cf_xarray/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,12 @@ def _get_ordered_vertices(
elif order == "descending":
endpoints = np.maximum(bounds[..., :, 0], bounds[..., :, 1])
last_endpoint = np.minimum(bounds[..., -1, 0], bounds[..., -1, 1])
else:
raise NotImplementedError(
f"Cannot determine vertices for non-monotonic bounds with {order} core "
Comment on lines +341 to +343
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @malmans2, I addressed your comment here. This PR is ready for another review.

The new else statement will catch any order that is not "ascending" or "descending". I kept the same error message (beside specifying the order value) because it should be helpful for the user.

"dimension orders. Try normalizing the coordinates to a monotonic "
"convention and try again."
)

vertices = np.concatenate(
[endpoints, np.expand_dims(last_endpoint, axis=-1)], axis=-1
Expand Down
Loading