Skip to content

Commit 28edadb

Browse files
committed
Add top-level astype function for Dask
1 parent e8a7890 commit 28edadb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sgkit/distarray.py

+6
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@
88
else:
99
# default to dask
1010
from dask.array import * # noqa: F401, F403
11+
12+
# dask doesn't have a top-level astype required by the array API
13+
def astype(x, dtype, /, *, copy=True):
14+
if not copy and dtype == x.dtype:
15+
return x
16+
return x.astype(dtype=dtype, copy=copy)

0 commit comments

Comments
 (0)