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 19, 2024
1 parent c359718 commit d522c0f
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 d522c0f

Please sign in to comment.