Skip to content

Commit e43aaa3

Browse files
committed
Fix logic for checking strictly monotonic
1 parent 80ced61 commit e43aaa3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

cf_xarray/helpers.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,9 @@ def _get_ordered_vertices(bounds: np.ndarray) -> np.ndarray:
280280

281281
def _is_bounds_strictly_monotonic(arr: np.ndarray) -> bool:
282282
"""
283-
Check if the array is strictly monotonic (all values ascend or descend
284-
across all intervals if flattened).
283+
Check if the input array is strictly monotonic (either strictly increasing
284+
or strictly decreasing) when flattened, ignoring any intervals where
285+
consecutive values are equal.
285286
286287
Parameters
287288
----------

0 commit comments

Comments
 (0)