Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
review comment
  • Loading branch information
hoxbro committed Dec 16, 2025
commit abd935aa1a97b0afb6e72b1a642adb6b977150c3
4 changes: 2 additions & 2 deletions xarray/core/duck_array_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def astype(data, dtype, *, xp=None, **kwargs):
if xp is None:
xp = get_array_namespace(data)

if xp is np or not hasattr(xp, "astype"):
if not hasattr(xp, "astype"):
return data.astype(dtype, **kwargs)
return xp.astype(data, dtype, **kwargs)

Expand All @@ -271,7 +271,7 @@ def asarray(data, xp=np, dtype=None):
if dtype is None or converted.dtype == dtype:
return converted

if xp is np or not hasattr(xp, "astype"):
if not hasattr(xp, "astype"):
return converted.astype(dtype)
else:
return xp.astype(converted, dtype)
Expand Down
Loading