Skip to content

Commit af88a61

Browse files
committed
Use array_api as opposed to signatures for 2021.12 autodoc
1 parent 1c3000e commit af88a61

20 files changed

+61
-47
lines changed

spec/2021.12/API_specification/array_object.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ Bitwise Operators
246246

247247
-------------------------------------------------
248248

249-
.. currentmodule:: signatures.array_object
249+
.. currentmodule:: array_api
250250

251251
Attributes
252252
----------

spec/2021.12/API_specification/constants.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ A conforming implementation of the array API standard must provide and support t
1010
Objects in API
1111
--------------
1212

13-
.. currentmodule:: signatures.constants
13+
.. currentmodule:: array_api
1414

1515
..
1616
NOTE: please keep the functions in alphabetical order

spec/2021.12/API_specification/creation_functions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ A conforming implementation of the array API standard must provide and support t
1111
Objects in API
1212
--------------
1313

14-
.. currentmodule:: signatures.creation_functions
14+
.. currentmodule:: array_api
1515

1616
..
1717
NOTE: please keep the functions in alphabetical order

spec/2021.12/API_specification/data_type_functions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ A conforming implementation of the array API standard must provide and support t
99
Objects in API
1010
--------------
1111

12-
.. currentmodule:: signatures.data_type_functions
12+
.. currentmodule:: array_api
1313

1414
..
1515
NOTE: please keep the functions in alphabetical order

spec/2021.12/API_specification/data_types.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ Methods
100100
..
101101
NOTE: please keep the functions in alphabetical order
102102
103-
.. currentmodule:: signatures.data_types
103+
.. currentmodule:: array_api.data_types
104104

105105
.. autosummary::
106106
:toctree: generated

spec/2021.12/API_specification/elementwise_functions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ A conforming implementation of the array API standard must provide and support t
1919
Objects in API
2020
--------------
2121

22-
.. currentmodule:: signatures.elementwise_functions
22+
.. currentmodule:: array_api
2323

2424
..
2525
NOTE: please keep the functions in alphabetical order

spec/2021.12/API_specification/indexing.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ Multi-dimensional arrays must extend the concept of single-axis indexing to mult
154154
- Each ``None`` in the selection tuple must expand the dimensions of the resulting selection by one dimension of size ``1``. The position of the added dimension must be the same as the position of ``None`` in the selection tuple.
155155

156156
.. note::
157-
Expanding dimensions can be equivalently achieved via repeated invocation of :func:`~signatures.manipulation_functions.expand_dims`.
157+
Expanding dimensions can be equivalently achieved via repeated invocation of :func:`~array_api.expand_dims`.
158158

159159
- Except in the case of providing a single ellipsis (e.g., ``A[2:10, ...]`` or ``A[1:, ..., 2:5]``), the number of provided single-axis indexing expressions (excluding ``None``) should equal ``N``. For example, if ``A`` has rank ``2``, a single-axis indexing expression should be explicitly provided for both axes (e.g., ``A[2:10, :]``). An ``IndexError`` exception should be raised if the number of provided single-axis indexing expressions (excluding ``None``) is less than ``N``.
160160

@@ -181,7 +181,7 @@ Boolean Array Indexing
181181
An array must support indexing where the **sole index** is an ``M``-dimensional boolean array ``B`` with shape ``S1 = (s1, ..., sM)`` according to the following rules. Let ``A`` be an ``N``-dimensional array with shape ``S2 = (s1, ..., sM, ..., sN)``.
182182

183183
.. note::
184-
The prohibition against combining boolean array indices with other single-axis indexing expressions includes the use of ``None``. To expand dimensions of the returned array, use repeated invocation of :func:`~signatures.manipulation_functions.expand_dims`.
184+
The prohibition against combining boolean array indices with other single-axis indexing expressions includes the use of ``None``. To expand dimensions of the returned array, use repeated invocation of :func:`~array_api.expand_dims`.
185185

186186
- If ``N >= M``, then ``A[B]`` must replace the first ``M`` dimensions of ``A`` with a single dimension having a size equal to the number of ``True`` elements in ``B``. The values in the resulting array must be in row-major (C-style order); this is equivalent to ``A[nonzero(B)]``.
187187

spec/2021.12/API_specification/linear_algebra_functions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A conforming implementation of the array API standard must provide and support t
1212
* Unless stated otherwise, functions must adhere to the type promotion rules defined in :ref:`type-promotion`.
1313
* Unless stated otherwise, floating-point operations must adhere to IEEE 754-2019.
1414

15-
.. currentmodule:: signatures.linear_algebra_functions
15+
.. currentmodule:: array_api
1616

1717
Objects in API
1818
--------------

spec/2021.12/API_specification/manipulation_functions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A conforming implementation of the array API standard must provide and support t
1212
Objects in API
1313
--------------
1414

15-
.. currentmodule:: signatures.manipulation_functions
15+
.. currentmodule:: array_api
1616

1717
..
1818
NOTE: please keep the functions in alphabetical order

spec/2021.12/API_specification/searching_functions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A conforming implementation of the array API standard must provide and support t
1616
Objects in API
1717
--------------
1818

19-
.. currentmodule:: signatures.searching_functions
19+
.. currentmodule:: array_api
2020

2121
..
2222
NOTE: please keep the functions in alphabetical order

spec/2021.12/API_specification/set_functions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ A conforming implementation of the array API standard must provide and support t
1212
Objects in API
1313
--------------
1414

15-
.. currentmodule:: signatures.set_functions
15+
.. currentmodule:: array_api
1616

1717
..
1818
NOTE: please keep the functions in alphabetical order

spec/2021.12/API_specification/sorting_functions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ A conforming implementation of the array API standard must provide and support t
1919

2020
While defining a sort order for IEEE 754 floating-point numbers is recommended in order to facilitate reproducible and consistent sort results, doing so is not currently required by this specification.
2121

22-
.. currentmodule:: signatures.sorting_functions
22+
.. currentmodule:: array_api
2323

2424
Objects in API
2525
--------------

spec/2021.12/API_specification/statistical_functions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A conforming implementation of the array API standard must provide and support t
1515
Objects in API
1616
--------------
1717

18-
.. currentmodule:: signatures.statistical_functions
18+
.. currentmodule:: array_api
1919

2020
..
2121
NOTE: please keep the functions in alphabetical order

spec/2021.12/API_specification/utility_functions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ A conforming implementation of the array API standard must provide and support t
1515
Objects in API
1616
--------------
1717

18-
.. currentmodule:: signatures.utility_functions
18+
.. currentmodule:: array_api
1919

2020
..
2121
NOTE: please keep the functions in alphabetical order

spec/2021.12/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
from _array_api_conf import *
55

66
release = "2021.12"
7-
sys.modules["signatures"] = stubs_mod
7+
sys.modules["array_api"] = stubs_mod

spec/2021.12/extensions/linear_algebra_functions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Accordingly, the standardization process affords the opportunity to reduce inter
7474

7575
where ``dot`` is overloaded based on input array dimensionality and ``vdot`` and ``inner`` exhibit a high degree of overlap with other interfaces. By consolidating interfaces and more clearly delineating behavior, this specification aims to ensure that each interface has a unique purpose and defined use case.
7676

77-
.. currentmodule:: signatures.linalg
77+
.. currentmodule:: array_api.linalg
7878

7979
Objects in API
8080
--------------
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from .array_object import *
2+
from .constants import *
3+
from .creation_functions import *
4+
from .data_type_functions import *
5+
from . import data_types as dtype
6+
from .elementwise_functions import *
7+
from .linear_algebra_functions import *
8+
from .manipulation_functions import *
9+
from .searching_functions import *
10+
from .set_functions import *
11+
from .sorting_functions import *
12+
from .statistical_functions import *
13+
from .utility_functions import *
14+
from . import linalg

src/array_api_stubs/_2021_12/array_object.py

+25-25
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def __abs__(self: array, /) -> array:
135135
136136
137137
.. note::
138-
Element-wise results must equal the results returned by the equivalent element-wise function :func:`~signatures.elementwise_functions.abs`.
138+
Element-wise results must equal the results returned by the equivalent element-wise function :func:`array_api.abs`.
139139
"""
140140

141141
def __add__(self: array, other: Union[int, float, array], /) -> array:
@@ -181,7 +181,7 @@ def __add__(self: array, other: Union[int, float, array], /) -> array:
181181
182182
183183
.. note::
184-
Element-wise results must equal the results returned by the equivalent element-wise function :func:`~signatures.elementwise_functions.add`.
184+
Element-wise results must equal the results returned by the equivalent element-wise function :func:`array_api.add`.
185185
"""
186186

187187
def __and__(self: array, other: Union[int, bool, array], /) -> array:
@@ -202,7 +202,7 @@ def __and__(self: array, other: Union[int, bool, array], /) -> array:
202202
203203
204204
.. note::
205-
Element-wise results must equal the results returned by the equivalent element-wise function :func:`~signatures.elementwise_functions.bitwise_and`.
205+
Element-wise results must equal the results returned by the equivalent element-wise function :func:`array_api.bitwise_and`.
206206
"""
207207

208208
def __array_namespace__(self: array, /, *, api_version: Optional[str] = None) -> Any:
@@ -239,7 +239,7 @@ def __bool__(self: array, /) -> bool:
239239

240240
def __dlpack__(self: array, /, *, stream: Optional[Union[int, Any]] = None) -> PyCapsule:
241241
"""
242-
Exports the array for consumption by :func:`~signatures.creation_functions.from_dlpack` as a DLPack capsule.
242+
Exports the array for consumption by :func:`array_api.from_dlpack` as a DLPack capsule.
243243
244244
Parameters
245245
----------
@@ -294,7 +294,7 @@ def __dlpack__(self: array, /, *, stream: Optional[Union[int, Any]] = None) -> P
294294

295295
def __dlpack_device__(self: array, /) -> Tuple[Enum, int]:
296296
"""
297-
Returns device type and device ID in DLPack format. Meant for use within :func:`~signatures.creation_functions.from_dlpack`.
297+
Returns device type and device ID in DLPack format. Meant for use within :func:`array_api.from_dlpack`.
298298
299299
Parameters
300300
----------
@@ -336,7 +336,7 @@ def __eq__(self: array, other: Union[int, float, bool, array], /) -> array:
336336
337337
338338
.. note::
339-
Element-wise results must equal the results returned by the equivalent element-wise function :func:`~signatures.elementwise_functions.equal`.
339+
Element-wise results must equal the results returned by the equivalent element-wise function :func:`array_api.equal`.
340340
"""
341341

342342
def __float__(self: array, /) -> float:
@@ -411,7 +411,7 @@ def __floordiv__(self: array, other: Union[int, float, array], /) -> array:
411411
412412
413413
.. note::
414-
Element-wise results must equal the results returned by the equivalent element-wise function :func:`~signatures.elementwise_functions.floor_divide`.
414+
Element-wise results must equal the results returned by the equivalent element-wise function :func:`array_api.floor_divide`.
415415
"""
416416

417417
def __ge__(self: array, other: Union[int, float, array], /) -> array:
@@ -432,7 +432,7 @@ def __ge__(self: array, other: Union[int, float, array], /) -> array:
432432
433433
434434
.. note::
435-
Element-wise results must equal the results returned by the equivalent element-wise function :func:`~signatures.elementwise_functions.greater_equal`.
435+
Element-wise results must equal the results returned by the equivalent element-wise function :func:`array_api.greater_equal`.
436436
"""
437437

438438
def __getitem__(self: array, key: Union[int, slice, ellipsis, Tuple[Union[int, slice, ellipsis], ...], array], /) -> array:
@@ -470,7 +470,7 @@ def __gt__(self: array, other: Union[int, float, array], /) -> array:
470470
471471
472472
.. note::
473-
Element-wise results must equal the results returned by the equivalent element-wise function :func:`~signatures.elementwise_functions.greater`.
473+
Element-wise results must equal the results returned by the equivalent element-wise function :func:`array_api.greater`.
474474
"""
475475

476476
def __index__(self: array, /) -> int:
@@ -522,7 +522,7 @@ def __invert__(self: array, /) -> array:
522522
523523
524524
.. note::
525-
Element-wise results must equal the results returned by the equivalent element-wise function :func:`~signatures.elementwise_functions.bitwise_invert`.
525+
Element-wise results must equal the results returned by the equivalent element-wise function :func:`array_api.bitwise_invert`.
526526
"""
527527

528528
def __le__(self: array, other: Union[int, float, array], /) -> array:
@@ -543,7 +543,7 @@ def __le__(self: array, other: Union[int, float, array], /) -> array:
543543
544544
545545
.. note::
546-
Element-wise results must equal the results returned by the equivalent element-wise function :func:`~signatures.elementwise_functions.less_equal`.
546+
Element-wise results must equal the results returned by the equivalent element-wise function :func:`array_api.less_equal`.
547547
"""
548548

549549
def __lshift__(self: array, other: Union[int, array], /) -> array:
@@ -564,7 +564,7 @@ def __lshift__(self: array, other: Union[int, array], /) -> array:
564564
565565
566566
.. note::
567-
Element-wise results must equal the results returned by the equivalent element-wise function :func:`~signatures.elementwise_functions.bitwise_left_shift`.
567+
Element-wise results must equal the results returned by the equivalent element-wise function :func:`array_api.bitwise_left_shift`.
568568
"""
569569

570570
def __lt__(self: array, other: Union[int, float, array], /) -> array:
@@ -585,7 +585,7 @@ def __lt__(self: array, other: Union[int, float, array], /) -> array:
585585
586586
587587
.. note::
588-
Element-wise results must equal the results returned by the equivalent element-wise function :func:`~signatures.elementwise_functions.less`.
588+
Element-wise results must equal the results returned by the equivalent element-wise function :func:`array_api.less`.
589589
"""
590590

591591
def __matmul__(self: array, other: array, /) -> array:
@@ -616,7 +616,7 @@ def __matmul__(self: array, other: array, /) -> array:
616616
617617
618618
.. note::
619-
Results must equal the results returned by the equivalent function :func:`~signatures.linear_algebra_functions.matmul`.
619+
Results must equal the results returned by the equivalent function :func:`array_api.matmul`.
620620
621621
**Raises**
622622
@@ -676,7 +676,7 @@ def __mod__(self: array, other: Union[int, float, array], /) -> array:
676676
677677
678678
.. note::
679-
Element-wise results must equal the results returned by the equivalent element-wise function :func:`~signatures.elementwise_functions.remainder`.
679+
Element-wise results must equal the results returned by the equivalent element-wise function :func:`array_api.remainder`.
680680
"""
681681

682682
def __mul__(self: array, other: Union[int, float, array], /) -> array:
@@ -715,7 +715,7 @@ def __mul__(self: array, other: Union[int, float, array], /) -> array:
715715
716716
717717
.. note::
718-
Element-wise results must equal the results returned by the equivalent element-wise function :func:`~signatures.elementwise_functions.multiply`.
718+
Element-wise results must equal the results returned by the equivalent element-wise function :func:`array_api.multiply`.
719719
"""
720720

721721
def __ne__(self: array, other: Union[int, float, bool, array], /) -> array:
@@ -736,7 +736,7 @@ def __ne__(self: array, other: Union[int, float, bool, array], /) -> array:
736736
737737
738738
.. note::
739-
Element-wise results must equal the results returned by the equivalent element-wise function :func:`~signatures.elementwise_functions.not_equal`.
739+
Element-wise results must equal the results returned by the equivalent element-wise function :func:`array_api.not_equal`.
740740
"""
741741

742742
def __neg__(self: array, /) -> array:
@@ -758,7 +758,7 @@ def __neg__(self: array, /) -> array:
758758
759759
760760
.. note::
761-
Element-wise results must equal the results returned by the equivalent element-wise function :func:`~signatures.elementwise_functions.negative`.
761+
Element-wise results must equal the results returned by the equivalent element-wise function :func:`array_api.negative`.
762762
"""
763763

764764
def __or__(self: array, other: Union[int, bool, array], /) -> array:
@@ -779,7 +779,7 @@ def __or__(self: array, other: Union[int, bool, array], /) -> array:
779779
780780
781781
.. note::
782-
Element-wise results must equal the results returned by the equivalent element-wise function :func:`~signatures.elementwise_functions.bitwise_or`.
782+
Element-wise results must equal the results returned by the equivalent element-wise function :func:`array_api.bitwise_or`.
783783
"""
784784

785785
def __pos__(self: array, /) -> array:
@@ -798,7 +798,7 @@ def __pos__(self: array, /) -> array:
798798
799799
800800
.. note::
801-
Element-wise results must equal the results returned by the equivalent element-wise function :func:`~signatures.elementwise_functions.positive`.
801+
Element-wise results must equal the results returned by the equivalent element-wise function :func:`array_api.positive`.
802802
"""
803803

804804
def __pow__(self: array, other: Union[int, float, array], /) -> array:
@@ -853,7 +853,7 @@ def __pow__(self: array, other: Union[int, float, array], /) -> array:
853853
854854
855855
.. note::
856-
Element-wise results must equal the results returned by the equivalent element-wise function :func:`~signatures.elementwise_functions.pow`.
856+
Element-wise results must equal the results returned by the equivalent element-wise function :func:`array_api.pow`.
857857
"""
858858

859859
def __rshift__(self: array, other: Union[int, array], /) -> array:
@@ -874,7 +874,7 @@ def __rshift__(self: array, other: Union[int, array], /) -> array:
874874
875875
876876
.. note::
877-
Element-wise results must equal the results returned by the equivalent element-wise function :func:`~signatures.elementwise_functions.bitwise_right_shift`.
877+
Element-wise results must equal the results returned by the equivalent element-wise function :func:`array_api.bitwise_right_shift`.
878878
"""
879879

880880
def __setitem__(self: array, key: Union[int, slice, ellipsis, Tuple[Union[int, slice, ellipsis], ...], array], value: Union[int, float, bool, array], /) -> None:
@@ -918,7 +918,7 @@ def __sub__(self: array, other: Union[int, float, array], /) -> array:
918918
919919
920920
.. note::
921-
Element-wise results must equal the results returned by the equivalent element-wise function :func:`~signatures.elementwise_functions.subtract`.
921+
Element-wise results must equal the results returned by the equivalent element-wise function :func:`array_api.subtract`.
922922
"""
923923

924924
def __truediv__(self: array, other: Union[int, float, array], /) -> array:
@@ -971,7 +971,7 @@ def __truediv__(self: array, other: Union[int, float, array], /) -> array:
971971
972972
973973
.. note::
974-
Element-wise results must equal the results returned by the equivalent element-wise function :func:`~signatures.elementwise_functions.divide`.
974+
Element-wise results must equal the results returned by the equivalent element-wise function :func:`array_api.divide`.
975975
"""
976976

977977
def __xor__(self: array, other: Union[int, bool, array], /) -> array:
@@ -992,7 +992,7 @@ def __xor__(self: array, other: Union[int, bool, array], /) -> array:
992992
993993
994994
.. note::
995-
Element-wise results must equal the results returned by the equivalent element-wise function :func:`~signatures.elementwise_functions.bitwise_xor`.
995+
Element-wise results must equal the results returned by the equivalent element-wise function :func:`array_api.bitwise_xor`.
996996
"""
997997

998998
def to_device(self: array, device: Device, /, *, stream: Optional[Union[int, Any]] = None) -> array:

src/array_api_stubs/_2021_12/creation_functions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def asarray(obj: Union[array, bool, int, float, NestedSequence, SupportsBufferPr
5454
.. admonition:: Note
5555
:class: note
5656
57-
If ``dtype`` is not ``None``, then array conversions should obey :ref:`type-promotion` rules. Conversions not specified according to :ref:`type-promotion` rules may or may not be permitted by a conforming array library. To perform an explicit cast, use :func:`signatures.data_type_functions.astype`.
57+
If ``dtype`` is not ``None``, then array conversions should obey :ref:`type-promotion` rules. Conversions not specified according to :ref:`type-promotion` rules may or may not be permitted by a conforming array library. To perform an explicit cast, use :func:`array_api.astype`.
5858
5959
.. note::
6060
If an input value exceeds the precision of the resolved output array data type, behavior is left unspecified and, thus, implementation-defined.

0 commit comments

Comments
 (0)