|
8 | 8 | __all__ = ["atleast_nd"]
|
9 | 9 |
|
10 | 10 |
|
11 |
| -def atleast_nd(x: Array, *, ndim: int, xp: ModuleType) -> Array: |
| 11 | +def atleast_nd(x: Array, /, *, ndim: int, xp: ModuleType) -> Array: |
12 | 12 | """
|
13 | 13 | Recursively expand the dimension of an array to at least `ndim`.
|
14 | 14 |
|
@@ -48,21 +48,24 @@ def atleast_nd(x: Array, *, ndim: int, xp: ModuleType) -> Array:
|
48 | 48 | return x
|
49 | 49 |
|
50 | 50 |
|
51 |
| -def expand_dims(a: Array, *, axis: tuple[int] = (0,), xp: ModuleType): |
| 51 | +def expand_dims( |
| 52 | + a: Array, /, *, axis: int | tuple[int, ...] = (0,), xp: ModuleType |
| 53 | +) -> Array: |
52 | 54 | """
|
53 | 55 | Expand the shape of an array.
|
54 | 56 |
|
55 |
| - Insert a new axis that will appear at the `axis` position in the expanded |
56 |
| - array shape. |
| 57 | + Insert (a) new axis/axes that will appear at the position(s) specified by |
| 58 | + `axis` in the expanded array shape. |
57 | 59 |
|
58 |
| - This is ``xp.expand_dims`` for ``axis`` an int *or a tuple of ints*. |
| 60 | + This is ``xp.expand_dims`` for `axis` an int *or a tuple of ints*. |
59 | 61 | Equivalent to ``numpy.expand_dims`` for NumPy arrays.
|
60 | 62 |
|
61 | 63 | Parameters
|
62 | 64 | ----------
|
63 | 65 | a : array
|
64 | 66 | axis : int or tuple of ints
|
65 | 67 | Position(s) in the expanded axes where the new axis (or axes) is/are placed.
|
| 68 | + Default: ``(0,)``. |
66 | 69 | xp : array_namespace
|
67 | 70 | The standard-compatible namespace for `a`.
|
68 | 71 |
|
@@ -120,7 +123,7 @@ def expand_dims(a: Array, *, axis: tuple[int] = (0,), xp: ModuleType):
|
120 | 123 | return a
|
121 | 124 |
|
122 | 125 |
|
123 |
| -def kron(a: Array, b: Array, *, xp: ModuleType): |
| 126 | +def kron(a: Array, b: Array, /, *, xp: ModuleType) -> Array: |
124 | 127 | """
|
125 | 128 | Kronecker product of two arrays.
|
126 | 129 |
|
|
0 commit comments