File tree Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Expand file tree Collapse file tree 2 files changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,16 @@ import numpy.array_api as np
5
5
6
6
import array_api_typing as xpt
7
7
8
+ # Define an NDArray against which we can test the protocols
9
+ arr = np .eye (2 )
10
+
8
11
###
9
12
# Ensure that `np.ndarray` instances are assignable to `xpt.HasArrayNamespace`.
10
13
11
- arr = np .eye (2 )
12
14
arr_namespace : xpt .HasArrayNamespace [Any ] = arr
15
+
16
+ ###
17
+ # Ensure that `np.ndarray` instances are assignable to `xpt.Array`.
18
+
19
+ arr_array : xpt .Array [Any , Any ] = arr
20
+ arr_floatarray : xpt .Array [float , Any ] = arr
Original file line number Diff line number Diff line change @@ -4,8 +4,17 @@ import numpy.typing as npt
4
4
5
5
import array_api_typing as xpt
6
6
7
+ # Define an NDArray against which we can test the protocols
8
+ arr : npt .NDArray [Any ]
9
+
7
10
###
8
11
# Ensure that `np.ndarray` instances are assignable to `xpt.HasArrayNamespace`.
9
12
10
- arr : npt .NDArray [Any ]
11
13
arr_namespace : xpt .HasArrayNamespace [Any ] = arr
14
+
15
+ ###
16
+ # Ensure that `np.ndarray` instances are assignable to `xpt.Array`.
17
+
18
+ arr_array : xpt .Array [Any , Any ] = arr
19
+ arr_floatarray : xpt .Array [float , Any ] = arr
20
+ arr_boolarray : xpt .Array [bool , Any ] = arr
You can’t perform that action at this time.
0 commit comments