Skip to content

Commit 0d66160

Browse files
committed
change namespace
1 parent a484d5a commit 0d66160

File tree

9 files changed

+9
-26
lines changed

9 files changed

+9
-26
lines changed

array_api_compat/_dask_ci_shim.py

Lines changed: 0 additions & 15 deletions
This file was deleted.

array_api_compat/common/_aliases.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,13 +324,11 @@ def _asarray(
324324
if copy in COPY_FALSE:
325325
# copy=False is not yet implemented in xp.asarray
326326
raise NotImplementedError("copy=False is not yet implemented")
327-
# TODO: This feels wrong (__array__ is not in the standard)
328-
# Dask doesn't support DLPack, though, so, this'll do
329327
if (hasattr(xp, "ndarray") and isinstance(obj, xp.ndarray)) or hasattr(obj, "__array__"):
330328
if dtype is not None and obj.dtype != dtype:
331329
copy = True
332330
# Dask arrays are immutable, so copy doesn't do anything
333-
if copy in COPY_TRUE and namespace != "dask":
331+
if copy in COPY_TRUE and namespace != "dask.array":
334332
return xp.array(obj, copy=True, dtype=dtype)
335333
return obj
336334

array_api_compat/dask/_aliases.py renamed to array_api_compat/dask/array/_aliases.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from __future__ import annotations
22

3-
from ..common import _aliases
4-
from ..common._helpers import _check_device
3+
from ...common import _aliases
4+
from ...common._helpers import _check_device
55

6-
from .._internal import get_xp
6+
from ..._internal import get_xp
77

88
import numpy as np
99
from numpy import (
@@ -36,7 +36,7 @@
3636
from typing import TYPE_CHECKING
3737
if TYPE_CHECKING:
3838
from typing import Optional, Union
39-
from ..common._typing import ndarray, Device, Dtype
39+
from ...common._typing import ndarray, Device, Dtype
4040

4141
import dask.array as da
4242

tests/test_common.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import numpy as np
66
from numpy.testing import assert_allclose
77

8-
@pytest.mark.parametrize("library", ["cupy", "numpy", "torch", "dask"])
8+
@pytest.mark.parametrize("library", ["cupy", "numpy", "torch", "dask.array"])
99
def test_to_device_host(library):
1010
# different libraries have different semantics
1111
# for DtoH transfers; ensure that we support a portable

tests/test_isdtype.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def isdtype_(dtype_, kind):
6464
assert type(res) is bool
6565
return res
6666

67-
@pytest.mark.parametrize("library", ["cupy", "numpy", "torch", "dask"])
67+
@pytest.mark.parametrize("library", ["cupy", "numpy", "torch", "dask.array"])
6868
def test_isdtype_spec_dtypes(library):
6969
xp = import_('array_api_compat.' + library)
7070

@@ -98,7 +98,7 @@ def test_isdtype_spec_dtypes(library):
9898
'bfloat16',
9999
]
100100

101-
@pytest.mark.parametrize("library", ["cupy", "numpy", "torch", "dask"])
101+
@pytest.mark.parametrize("library", ["cupy", "numpy", "torch", "dask.array"])
102102
@pytest.mark.parametrize("dtype_", additional_dtypes)
103103
def test_isdtype_additional_dtypes(library, dtype_):
104104
xp = import_('array_api_compat.' + library)

vendor_test/.DS_Store

6 KB
Binary file not shown.

vendor_test/uses_dask.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Basic test that vendoring works
22

3-
from .vendored._compat import dask as dask_compat
3+
from .vendored._compat.dask import array as dask_compat
44

55
import dask.array as da
66
import numpy as np

0 commit comments

Comments
 (0)