Skip to content

Commit

Permalink
Add top-level astype function for Dask
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwhite committed Sep 16, 2024
1 parent e8a7890 commit 4588f19
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sgkit/distarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@
else:
# default to dask
from dask.array import * # noqa: F401, F403

# dask doesn't have a top-level astype required by the array API
def astype(x, dtype, /, *, copy=True): # pragma: no cover
if not copy and dtype == x.dtype:
return x
return x.astype(dtype=dtype, copy=copy)

0 comments on commit 4588f19

Please sign in to comment.