Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
lithomas1 committed Jan 11, 2024
1 parent 64d20c4 commit 762a03c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion array_api_compat/common/_aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ def _asarray(
import numpy as xp
elif namespace == 'cupy':
import cupy as xp
elif namespace == 'dask':
elif namespace == 'dask.array':
import dask.array as xp
else:
raise ValueError("Unrecognized namespace argument to asarray()")
Expand Down
2 changes: 1 addition & 1 deletion array_api_compat/dask/array/_aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def dask_arange(
eye = get_xp(da)(_aliases.eye)

from functools import partial
asarray = partial(_aliases._asarray, namespace='dask')
asarray = partial(_aliases._asarray, namespace='dask.array')
asarray.__doc__ = _aliases._asarray.__doc__

linspace = get_xp(da)(_aliases.linspace)
Expand Down
5 changes: 3 additions & 2 deletions tests/test_array_namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ def test_array_namespace(library, api_version):
assert namespace == lib
else:
if library == "dask.array":
library = "dask"
assert namespace == getattr(array_api_compat, library)
assert namespace == array_api_compat.dask.array
else:
assert namespace == getattr(array_api_compat, library)


def test_array_namespace_errors():
Expand Down

0 comments on commit 762a03c

Please sign in to comment.