Skip to content

Commit 96d8f5e

Browse files
committed
revert rename _check_device -> _validate_device
1 parent 8c8b5c5 commit 96d8f5e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Diff for: array_api_compat/common/_helpers.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,7 @@ def _device_ctx(
831831
raise AssertionError("unreachable") # pragma: nocover
832832

833833

834-
def _validate_device(bare_xp: Namespace, device: Device) -> None:
834+
def _check_device(bare_xp: Namespace, device: Device) -> None:
835835
with _device_ctx(bare_xp, device):
836836
pass
837837

Diff for: array_api_compat/dask/array/_aliases.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def astype(
5656
specification for more details.
5757
"""
5858
# TODO: respect device keyword?
59-
_helpers._validate_device(da, device)
59+
_helpers._check_device(da, device)
6060

6161
if not copy and dtype == x.dtype:
6262
return x
@@ -87,7 +87,7 @@ def arange(
8787
specification for more details.
8888
"""
8989
# TODO: respect device keyword?
90-
_helpers._validate_device(da, device)
90+
_helpers._check_device(da, device)
9191

9292
args = [start]
9393
if stop is not None:
@@ -157,7 +157,7 @@ def asarray(
157157
specification for more details.
158158
"""
159159
# TODO: respect device keyword?
160-
_helpers._validate_device(da, device)
160+
_helpers._check_device(da, device)
161161

162162
if isinstance(obj, da.Array):
163163
if dtype is not None and dtype != obj.dtype:

Diff for: array_api_compat/numpy/_aliases.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def asarray(
9595
See the corresponding documentation in the array library and/or the array API
9696
specification for more details.
9797
"""
98-
_helpers._validate_device(np, device)
98+
_helpers._check_device(np, device)
9999

100100
if hasattr(np, '_CopyMode'):
101101
if copy is None:
@@ -121,7 +121,7 @@ def astype(
121121
copy: bool = True,
122122
device: Optional[Device] = None,
123123
) -> Array:
124-
_helpers._validate_device(np, device)
124+
_helpers._check_device(np, device)
125125
return x.astype(dtype=dtype, copy=copy)
126126

127127

0 commit comments

Comments
 (0)