Skip to content

Commit abd935a

Browse files
committed
review comment
1 parent 0e85b77 commit abd935a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

xarray/core/duck_array_ops.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ def astype(data, dtype, *, xp=None, **kwargs):
253253
if xp is None:
254254
xp = get_array_namespace(data)
255255

256-
if xp is np or not hasattr(xp, "astype"):
256+
if not hasattr(xp, "astype"):
257257
return data.astype(dtype, **kwargs)
258258
return xp.astype(data, dtype, **kwargs)
259259

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

274-
if xp is np or not hasattr(xp, "astype"):
274+
if not hasattr(xp, "astype"):
275275
return converted.astype(dtype)
276276
else:
277277
return xp.astype(converted, dtype)

0 commit comments

Comments
 (0)