summaryrefslogtreecommitdiff
path: root/numpy/_array_api
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/_array_api')
-rw-r--r--numpy/_array_api/_array_object.py5
-rw-r--r--numpy/_array_api/_creation_functions.py7
-rw-r--r--numpy/_array_api/_data_type_functions.py5
-rw-r--r--numpy/_array_api/_elementwise_functions.py5
-rw-r--r--numpy/_array_api/_linear_algebra_functions.py5
-rw-r--r--numpy/_array_api/_manipulation_functions.py5
-rw-r--r--numpy/_array_api/_searching_functions.py5
-rw-r--r--numpy/_array_api/_set_functions.py5
-rw-r--r--numpy/_array_api/_sorting_functions.py5
-rw-r--r--numpy/_array_api/_statistical_functions.py5
-rw-r--r--numpy/_array_api/_utility_functions.py5
11 files changed, 45 insertions, 12 deletions
diff --git a/numpy/_array_api/_array_object.py b/numpy/_array_api/_array_object.py
index 371361de9..4b11a0ca0 100644
--- a/numpy/_array_api/_array_object.py
+++ b/numpy/_array_api/_array_object.py
@@ -17,10 +17,13 @@ from __future__ import annotations
import operator
from enum import IntEnum
-from ._types import Optional, PyCapsule, Tuple, Union, array
from ._creation_functions import asarray
from ._dtypes import _boolean_dtypes, _integer_dtypes
+from typing import TYPE_CHECKING
+if TYPE_CHECKING:
+ from ._types import Optional, PyCapsule, Tuple, Union, array
+
import numpy as np
class ndarray:
diff --git a/numpy/_array_api/_creation_functions.py b/numpy/_array_api/_creation_functions.py
index cee379f59..e9ef983fd 100644
--- a/numpy/_array_api/_creation_functions.py
+++ b/numpy/_array_api/_creation_functions.py
@@ -1,7 +1,10 @@
from __future__ import annotations
-from ._types import (Optional, SupportsDLPack, SupportsBufferProtocol, Tuple,
- Union, array, device, dtype)
+
+from typing import TYPE_CHECKING
+if TYPE_CHECKING:
+ from ._types import (Optional, SupportsDLPack, SupportsBufferProtocol, Tuple,
+ Union, array, device, dtype)
from ._dtypes import _all_dtypes
import numpy as np
diff --git a/numpy/_array_api/_data_type_functions.py b/numpy/_array_api/_data_type_functions.py
index 9e4dcba95..0488ba915 100644
--- a/numpy/_array_api/_data_type_functions.py
+++ b/numpy/_array_api/_data_type_functions.py
@@ -1,8 +1,11 @@
from __future__ import annotations
-from ._types import Union, array, dtype
from ._array_object import ndarray
+from typing import TYPE_CHECKING
+if TYPE_CHECKING:
+ from ._types import Union, array, dtype
+
from collections.abc import Sequence
import numpy as np
diff --git a/numpy/_array_api/_elementwise_functions.py b/numpy/_array_api/_elementwise_functions.py
index 9efe17e83..cd2e8661f 100644
--- a/numpy/_array_api/_elementwise_functions.py
+++ b/numpy/_array_api/_elementwise_functions.py
@@ -2,9 +2,12 @@ from __future__ import annotations
from ._dtypes import (_boolean_dtypes, _floating_dtypes,
_integer_dtypes, _integer_or_boolean_dtypes, _numeric_dtypes)
-from ._types import array
from ._array_object import ndarray
+from typing import TYPE_CHECKING
+if TYPE_CHECKING:
+ from ._types import array
+
import numpy as np
def abs(x: array, /) -> array:
diff --git a/numpy/_array_api/_linear_algebra_functions.py b/numpy/_array_api/_linear_algebra_functions.py
index 95ed00fd5..f57fe292a 100644
--- a/numpy/_array_api/_linear_algebra_functions.py
+++ b/numpy/_array_api/_linear_algebra_functions.py
@@ -1,8 +1,11 @@
from __future__ import annotations
-from ._types import Literal, Optional, Tuple, Union, array
from ._array_object import ndarray
+from typing import TYPE_CHECKING
+if TYPE_CHECKING:
+ from ._types import Literal, Optional, Tuple, Union, array
+
import numpy as np
# def cholesky():
diff --git a/numpy/_array_api/_manipulation_functions.py b/numpy/_array_api/_manipulation_functions.py
index 1631a924f..4e5ca0728 100644
--- a/numpy/_array_api/_manipulation_functions.py
+++ b/numpy/_array_api/_manipulation_functions.py
@@ -1,8 +1,11 @@
from __future__ import annotations
-from ._types import Optional, Tuple, Union, array
from ._array_object import ndarray
+from typing import TYPE_CHECKING
+if TYPE_CHECKING:
+ from ._types import Optional, Tuple, Union, array
+
import numpy as np
def concat(arrays: Tuple[array], /, *, axis: Optional[int] = 0) -> array:
diff --git a/numpy/_array_api/_searching_functions.py b/numpy/_array_api/_searching_functions.py
index 44e5b2775..9a5d583bc 100644
--- a/numpy/_array_api/_searching_functions.py
+++ b/numpy/_array_api/_searching_functions.py
@@ -1,8 +1,11 @@
from __future__ import annotations
-from ._types import Tuple, array
from ._array_object import ndarray
+from typing import TYPE_CHECKING
+if TYPE_CHECKING:
+ from ._types import Tuple, array
+
import numpy as np
def argmax(x: array, /, *, axis: int = None, keepdims: bool = False) -> array:
diff --git a/numpy/_array_api/_set_functions.py b/numpy/_array_api/_set_functions.py
index f5cd6d324..025a27d80 100644
--- a/numpy/_array_api/_set_functions.py
+++ b/numpy/_array_api/_set_functions.py
@@ -1,8 +1,11 @@
from __future__ import annotations
-from ._types import Tuple, Union, array
from ._array_object import ndarray
+from typing import TYPE_CHECKING
+if TYPE_CHECKING:
+ from ._types import Tuple, Union, array
+
import numpy as np
def unique(x: array, /, *, return_counts: bool = False, return_index: bool = False, return_inverse: bool = False) -> Union[array, Tuple[array, ...]]:
diff --git a/numpy/_array_api/_sorting_functions.py b/numpy/_array_api/_sorting_functions.py
index 2e054b03a..6e87bd90e 100644
--- a/numpy/_array_api/_sorting_functions.py
+++ b/numpy/_array_api/_sorting_functions.py
@@ -1,8 +1,11 @@
from __future__ import annotations
-from ._types import array
from ._array_object import ndarray
+from typing import TYPE_CHECKING
+if TYPE_CHECKING:
+ from ._types import array
+
import numpy as np
def argsort(x: array, /, *, axis: int = -1, descending: bool = False, stable: bool = True) -> array:
diff --git a/numpy/_array_api/_statistical_functions.py b/numpy/_array_api/_statistical_functions.py
index fa3551248..26afd7354 100644
--- a/numpy/_array_api/_statistical_functions.py
+++ b/numpy/_array_api/_statistical_functions.py
@@ -1,8 +1,11 @@
from __future__ import annotations
-from ._types import Optional, Tuple, Union, array
from ._array_object import ndarray
+from typing import TYPE_CHECKING
+if TYPE_CHECKING:
+ from ._types import Optional, Tuple, Union, array
+
import numpy as np
def max(x: array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = None, keepdims: bool = False) -> array:
diff --git a/numpy/_array_api/_utility_functions.py b/numpy/_array_api/_utility_functions.py
index c4721ad7e..e280b5785 100644
--- a/numpy/_array_api/_utility_functions.py
+++ b/numpy/_array_api/_utility_functions.py
@@ -1,8 +1,11 @@
from __future__ import annotations
-from ._types import Optional, Tuple, Union, array
from ._array_object import ndarray
+from typing import TYPE_CHECKING
+if TYPE_CHECKING:
+ from ._types import Optional, Tuple, Union, array
+
import numpy as np
def all(x: array, /, *, axis: Optional[Union[int, Tuple[int, ...]]] = None, keepdims: bool = False) -> array: