Skip to content

Commit feb81db

Browse files
committed
tidy: Update comment
np.astype became available in numpy 2.1 The special case is still needed, however, to support older numpy as well as dask.
1 parent 22bd964 commit feb81db

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

xarray/core/duck_array_ops.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def astype(data, dtype, *, xp=None, **kwargs):
247247
xp = get_array_namespace(data)
248248

249249
if xp == np:
250-
# numpy currently doesn't have a astype:
250+
# numpy<2.1 and dask don't have astype in their namespace
251251
return data.astype(dtype, **kwargs)
252252
return xp.astype(data, dtype, **kwargs)
253253

0 commit comments

Comments
 (0)