Skip to content

Commit 2f3d9e8

Browse files
committed
Add typecasting to prevent numpy 1.26.4 issue
1 parent 697a9a2 commit 2f3d9e8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

cf_xarray/helpers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,8 @@ def _get_core_dim_orders(core_dim_coords: dict[str, np.ndarray]) -> dict[str, st
232232
else:
233233
zero = 0
234234

235-
nonzero_diffs = diffs[diffs != zero]
235+
# Ensure diffs and zero have the same dtype for comparison.
236+
nonzero_diffs = diffs[diffs != diffs.dtype.type(zero)]
236237

237238
if nonzero_diffs.size == 0:
238239
# All values are equal, treat as ascending

0 commit comments

Comments
 (0)