Skip to content

Commit ada9102

Browse files
committed
Fix 2021.12 building
1 parent c74b390 commit ada9102

23 files changed

+76
-253
lines changed

spec/2021.12/API_specification/array_object.rst

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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
104104

105105
.. autosummary::
106106
:toctree: generated

spec/2021.12/API_specification/elementwise_functions.rst

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 4 additions & 203 deletions
Original file line numberDiff line numberDiff line change
@@ -1,206 +1,7 @@
1-
# Configuration file for the Sphinx documentation builder.
2-
#
3-
# This file only contains a selection of the most common options. For a full
4-
# list see the documentation:
5-
# https://www.sphinx-doc.org/en/master/usage/configuration.html
6-
7-
# -- Path setup --------------------------------------------------------------
8-
9-
# If extensions (or modules to document with autodoc) are in another directory,
10-
# add these directories to sys.path here. If the directory is relative to the
11-
# documentation root, use os.path.abspath to make it absolute, like shown here.
12-
#
13-
import os
141
import sys
15-
import sphinx_material
16-
sys.path.insert(0, os.path.abspath('./API_specification'))
17-
18-
# -- Project information -----------------------------------------------------
19-
20-
project = 'Python array API standard'
21-
copyright = '2020, Consortium for Python Data API Standards'
22-
author = 'Consortium for Python Data API Standards'
23-
24-
# The full version, including alpha/beta/rc tags
25-
release = '2021.12'
26-
27-
28-
# -- General configuration ---------------------------------------------------
29-
30-
# Add any Sphinx extension module names here, as strings. They can be
31-
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
32-
# ones.
33-
extensions = [
34-
'myst_parser',
35-
'sphinx.ext.extlinks',
36-
'sphinx.ext.intersphinx',
37-
'sphinx.ext.todo',
38-
'sphinx_markdown_tables',
39-
'sphinx_copybutton',
40-
'sphinx.ext.autosummary',
41-
'sphinx.ext.napoleon',
42-
'sphinx.ext.autodoc',
43-
]
44-
45-
autosummary_generate = True
46-
autodoc_typehints = 'signature'
47-
add_module_names = False
48-
napoleon_custom_sections = [('Returns', 'params_style')]
49-
default_role = 'code'
50-
51-
# nitpicky = True makes Sphinx warn whenever a cross-reference target can't be
52-
# found.
53-
nitpicky = True
54-
# autodoc wants to make cross-references for every type hint. But a lot of
55-
# them don't actually refer to anything that we have a document for.
56-
nitpick_ignore = [
57-
('py:class', 'array'),
58-
('py:class', 'device'),
59-
('py:class', 'dtype'),
60-
('py:class', 'NestedSequence'),
61-
('py:class', 'SupportsBufferProtocol'),
62-
('py:class', 'collections.abc.Sequence'),
63-
('py:class', "Optional[Union[int, float, Literal[inf, - inf, 'fro', 'nuc']]]"),
64-
('py:class', "Union[int, float, Literal[inf, - inf]]"),
65-
('py:obj', "typing.Optional[typing.Union[int, float, typing.Literal[inf, - inf, 'fro', 'nuc']]]"),
66-
('py:obj', "typing.Union[int, float, typing.Literal[inf, - inf]]"),
67-
('py:class', 'PyCapsule'),
68-
('py:class', 'enum.Enum'),
69-
('py:class', 'ellipsis'),
70-
('py:class', 'finfo_object'),
71-
('py:class', 'iinfo_object'),
72-
]
73-
# In array_object.py we have to use aliased names for some types because they
74-
# would otherwise refer back to method objects of array
75-
autodoc_type_aliases = {
76-
'array': 'array',
77-
'Device': 'device',
78-
'Dtype': 'dtype',
79-
}
80-
81-
# Make autosummary show the signatures of functions in the tables using actual
82-
# Python syntax. There's currently no supported way to do this, so we have to
83-
# just patch out the function that processes the signatures. See
84-
# https://github.com/sphinx-doc/sphinx/issues/10053.
85-
import sphinx.ext.autosummary as autosummary_mod
86-
if hasattr(autosummary_mod, '_module'):
87-
# It's a sphinx deprecated module wrapper object
88-
autosummary_mod = autosummary_mod._module
89-
autosummary_mod.mangle_signature = lambda sig, max_chars=30: sig
90-
91-
# Add any paths that contain templates here, relative to this directory.
92-
templates_path = ['_templates']
93-
94-
# List of patterns, relative to source directory, that match files and
95-
# directories to ignore when looking for source files.
96-
# This pattern also affects html_static_path and html_extra_path.
97-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
98-
99-
# MyST options
100-
myst_heading_anchors = 3
101-
myst_enable_extensions = ["colon_fence"]
102-
103-
# -- Options for HTML output -------------------------------------------------
104-
105-
# The theme to use for HTML and HTML Help pages. See the documentation for
106-
# a list of builtin themes.
107-
#
108-
extensions.append("sphinx_material")
109-
html_theme_path = sphinx_material.html_theme_path()
110-
html_context = sphinx_material.get_html_context()
111-
html_theme = 'sphinx_material'
112-
113-
# Add any paths that contain custom static files (such as style sheets) here,
114-
# relative to this directory. They are copied after the builtin static files,
115-
# so a file named "default.css" will overwrite the builtin "default.css".
116-
html_static_path = ['_static']
117-
118-
119-
# -- Material theme options (see theme.conf for more information) ------------
120-
html_show_sourcelink = False
121-
html_sidebars = {
122-
"**": ["logo-text.html", "globaltoc.html", "localtoc.html", "searchbox.html"]
123-
}
124-
125-
html_theme_options = {
126-
127-
# Set the name of the project to appear in the navigation.
128-
'nav_title': f'Python array API standard {release}',
129-
130-
# Set you GA account ID to enable tracking
131-
#'google_analytics_account': 'UA-XXXXX',
132-
133-
# Specify a base_url used to generate sitemap.xml. If not
134-
# specified, then no sitemap will be built.
135-
#'base_url': 'https://project.github.io/project',
136-
137-
# Set the color and the accent color (see
138-
# https://material.io/design/color/the-color-system.html)
139-
'color_primary': 'indigo',
140-
'color_accent': 'green',
141-
142-
# Set the repo location to get a badge with stats
143-
#'repo_url': 'https://github.com/project/project/',
144-
#'repo_name': 'Project',
145-
146-
"html_minify": False,
147-
"html_prettify": False,
148-
"css_minify": True,
149-
"logo_icon": "&#xe869",
150-
"repo_type": "github",
151-
"touch_icon": "images/apple-icon-152x152.png",
152-
"theme_color": "#2196f3",
153-
"master_doc": False,
154-
155-
# Visible levels of the global TOC; -1 means unlimited
156-
'globaltoc_depth': 2,
157-
# If False, expand all TOC entries
158-
'globaltoc_collapse': True,
159-
# If True, show hidden TOC entries
160-
'globaltoc_includehidden': True,
161-
162-
"nav_links": [
163-
{"href": "index", "internal": True, "title": "Array API standard"},
164-
{
165-
"href": "https://data-apis.org",
166-
"internal": False,
167-
"title": "Consortium for Python Data API Standards",
168-
},
169-
],
170-
"heroes": {
171-
"index": "A common API for array and tensor Python libraries",
172-
#"customization": "Configuration options to personalize your site.",
173-
},
174-
175-
"version_dropdown": True,
176-
"version_json": "../versions.json",
177-
"table_classes": ["plain"],
178-
}
179-
180-
181-
todo_include_todos = True
182-
#html_favicon = "images/favicon.ico"
183-
184-
html_use_index = True
185-
html_domain_indices = True
186-
187-
extlinks = {
188-
"duref": (
189-
"http://docutils.sourceforge.net/docs/ref/rst/" "restructuredtext.html#%s",
190-
"",
191-
),
192-
"durole": ("http://docutils.sourceforge.net/docs/ref/rst/" "roles.html#%s", ""),
193-
"dudir": ("http://docutils.sourceforge.net/docs/ref/rst/" "directives.html#%s", ""),
194-
"pypa": ("https://packaging.python.org/%s", ""),
195-
}
196-
1972

198-
def process_signature(app, what, name, obj, options, signature, return_annotation):
199-
if signature:
200-
signature = signature.replace("signatures._types.", "")
201-
if return_annotation:
202-
return_annotation = return_annotation.replace("signatures._types.", "")
203-
return signature, return_annotation
3+
from array_api_stubs import _2021_12 as stubs_mod
4+
from _array_api_conf import *
2045

205-
def setup(app):
206-
app.connect("autodoc-process-signature", process_signature)
6+
release = "2021.12"
7+
sys.modules["array_api"] = stubs_mod

spec/2021.12/extensions/linear_algebra_functions.rst

Lines changed: 1 addition & 1 deletion
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
--------------

spec/2022.12/API_specification/data_types.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,13 @@ Methods
101101
..
102102
NOTE: please keep the functions in alphabetical order
103103
104-
.. currentmodule:: array_api.data_types
104+
.. currentmodule:: array_api
105105

106106
.. autosummary::
107107
:toctree: generated
108108
:template: method.rst
109109

110-
__eq__
110+
dtype.__eq__
111111

112112

113113
.. _data-type-defaults:
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""Function stubs and API documentation for the array API standard."""
2+
3+
from .array_object import *
4+
from .constants import *
5+
from .creation_functions import *
6+
from .data_type_functions import *
7+
from . import data_types as dtype
8+
from .elementwise_functions import *
9+
from .linear_algebra_functions import *
10+
from .manipulation_functions import *
11+
from .searching_functions import *
12+
from .set_functions import *
13+
from .sorting_functions import *
14+
from .statistical_functions import *
15+
from .utility_functions import *
16+
from . import linalg
17+
18+
19+
__array_api_version__: str = "YYYY.MM"
20+
"""
21+
String representing the version of the array API specification which the conforming implementation adheres to.
22+
"""

0 commit comments

Comments
 (0)