Skip to content

Commit 382a4dd

Browse files
committed
DOC: italicize RFC magic must/must not, should/should not
$ sed -E -i "/not/! s/must/\*must\*/g" ./*.rst $ sed -E -i "s/must not/\*must not\*/g" ./*.rst $ sed -E -i "/not/! s/should/\*should\*/g" ./*.rst etc
1 parent 6d205d7 commit 382a4dd

31 files changed

+130
-130
lines changed

Diff for: spec/draft/API_specification/array_object.rst

+19-19
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ Array object
55

66
Array API specification for array object attributes and methods.
77

8-
A conforming implementation of the array API standard must provide and support an array object having the following attributes and methods.
8+
A conforming implementation of the array API standard *must* provide and support an array object having the following attributes and methods.
99

10-
Furthermore, a conforming implementation of the array API standard must support, at minimum, array objects of rank (i.e., number of dimensions) ``0``, ``1``, ``2``, ``3``, and ``4`` and must explicitly document their maximum supported rank ``N``.
10+
Furthermore, a conforming implementation of the array API standard *must* support, at minimum, array objects of rank (i.e., number of dimensions) ``0``, ``1``, ``2``, ``3``, and ``4`` and *must* explicitly document their maximum supported rank ``N``.
1111

1212
.. note::
13-
Conforming implementations must support zero-dimensional arrays.
13+
Conforming implementations *must* support zero-dimensional arrays.
1414

1515
Apart from array object attributes, such as ``ndim``, ``device``, and ``dtype``, all operations in this standard return arrays (or tuples of arrays), including those operations, such as ``mean``, ``var``, and ``std``, from which some common array libraries (e.g., NumPy) return scalar values.
1616

@@ -23,12 +23,12 @@ Furthermore, a conforming implementation of the array API standard must support,
2323
Operators
2424
---------
2525

26-
A conforming implementation of the array API standard must provide and support an array object supporting the following Python operators.
26+
A conforming implementation of the array API standard *must* provide and support an array object supporting the following Python operators.
2727

2828
Arithmetic Operators
2929
~~~~~~~~~~~~~~~~~~~~
3030

31-
A conforming implementation of the array API standard must provide and support an array object supporting the following Python arithmetic operators.
31+
A conforming implementation of the array API standard *must* provide and support an array object supporting the following Python arithmetic operators.
3232

3333
- ``+x``: :meth:`.array.__pos__`
3434

@@ -75,24 +75,24 @@ A conforming implementation of the array API standard must provide and support a
7575
- `operator.pow(x1, x2) <https://docs.python.org/3/library/operator.html#operator.pow>`_
7676
- `operator.__pow__(x1, x2) <https://docs.python.org/3/library/operator.html#operator.__pow__>`_
7777

78-
Arithmetic operators should be defined for arrays having real-valued data types.
78+
Arithmetic operators *should* be defined for arrays having real-valued data types.
7979

8080
Array Operators
8181
~~~~~~~~~~~~~~~
8282

83-
A conforming implementation of the array API standard must provide and support an array object supporting the following Python array operators.
83+
A conforming implementation of the array API standard *must* provide and support an array object supporting the following Python array operators.
8484

8585
- `x1 @ x2`: :meth:`.array.__matmul__`
8686

8787
- `operator.matmul(x1, x2) <https://docs.python.org/3/library/operator.html#operator.matmul>`_
8888
- `operator.__matmul__(x1, x2) <https://docs.python.org/3/library/operator.html#operator.__matmul__>`_
8989

90-
The matmul ``@`` operator should be defined for arrays having real-valued data types.
90+
The matmul ``@`` operator *should* be defined for arrays having real-valued data types.
9191

9292
Bitwise Operators
9393
~~~~~~~~~~~~~~~~~
9494

95-
A conforming implementation of the array API standard must provide and support an array object supporting the following Python bitwise operators.
95+
A conforming implementation of the array API standard *must* provide and support an array object supporting the following Python bitwise operators.
9696

9797
- `~x`: :meth:`.array.__invert__`
9898

@@ -126,12 +126,12 @@ A conforming implementation of the array API standard must provide and support a
126126
- `operator.rshift(x1, x2) <https://docs.python.org/3/library/operator.html#operator.rshift>`_
127127
- `operator.__rshift__(x1, x2) <https://docs.python.org/3/library/operator.html#operator.__rshift__>`_
128128

129-
Bitwise operators should be defined for arrays having integer and boolean data types.
129+
Bitwise operators *should* be defined for arrays having integer and boolean data types.
130130

131131
Comparison Operators
132132
~~~~~~~~~~~~~~~~~~~~
133133

134-
A conforming implementation of the array API standard must provide and support an array object supporting the following Python comparison operators.
134+
A conforming implementation of the array API standard *must* provide and support an array object supporting the following Python comparison operators.
135135

136136
- `x1 < x2`: :meth:`.array.__lt__`
137137

@@ -163,20 +163,20 @@ A conforming implementation of the array API standard must provide and support a
163163
- `operator.ne(x1, x2) <https://docs.python.org/3/library/operator.html#operator.ne>`_
164164
- `operator.__ne__(x1, x2) <https://docs.python.org/3/library/operator.html#operator.__ne__>`_
165165

166-
:meth:`.array.__lt__`, :meth:`.array.__le__`, :meth:`.array.__gt__`, :meth:`.array.__ge__` are only defined for arrays having real-valued data types. Other comparison operators should be defined for arrays having any data type.
166+
:meth:`.array.__lt__`, :meth:`.array.__le__`, :meth:`.array.__gt__`, :meth:`.array.__ge__` are only defined for arrays having real-valued data types. Other comparison operators *should* be defined for arrays having any data type.
167167
For backward compatibility, conforming implementations may support complex numbers; however, inequality comparison of complex numbers is unspecified and thus implementation-dependent (see :ref:`complex-number-ordering`).
168168

169169
In-place Operators
170170
~~~~~~~~~~~~~~~~~~
171171

172-
A conforming implementation of the array API standard must provide and support an array object supporting the following in-place Python operators.
172+
A conforming implementation of the array API standard *must* provide and support an array object supporting the following in-place Python operators.
173173

174-
An in-place operation must not change the data type or shape of the in-place array as a result of :ref:`type-promotion` or :ref:`broadcasting`.
174+
An in-place operation *must not* change the data type or shape of the in-place array as a result of :ref:`type-promotion` or :ref:`broadcasting`.
175175

176-
An in-place operation must have the same behavior (including special cases) as its respective binary (i.e., two operand, non-assignment) operation. For example, after in-place addition ``x1 += x2``, the modified array ``x1`` must always equal the result of the equivalent binary arithmetic operation ``x1 = x1 + x2``.
176+
An in-place operation *must* have the same behavior (including special cases) as its respective binary (i.e., two operand, non-assignment) operation. For example, after in-place addition ``x1 += x2``, the modified array ``x1`` *must* always equal the result of the equivalent binary arithmetic operation ``x1 = x1 + x2``.
177177

178178
.. note::
179-
In-place operators must be supported as discussed in :ref:`copyview-mutability`.
179+
In-place operators *must* be supported as discussed in :ref:`copyview-mutability`.
180180

181181
Arithmetic Operators
182182
""""""""""""""""""""
@@ -206,12 +206,12 @@ Bitwise Operators
206206
Reflected Operators
207207
~~~~~~~~~~~~~~~~~~~
208208

209-
A conforming implementation of the array API standard must provide and support an array object supporting the following reflected operators.
209+
A conforming implementation of the array API standard *must* provide and support an array object supporting the following reflected operators.
210210

211-
The results of applying reflected operators must match their non-reflected equivalents.
211+
The results of applying reflected operators *must* match their non-reflected equivalents.
212212

213213
.. note::
214-
All operators for which ``array <op> scalar`` is implemented must have an equivalent reflected operator implementation.
214+
All operators for which ``array <op> scalar`` is implemented *must* have an equivalent reflected operator implementation.
215215

216216
Arithmetic Operators
217217
""""""""""""""""""""

Diff for: spec/draft/API_specification/broadcasting.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Given an element-wise operation involving two compatible arrays, an array having
1919

2020
If two arrays are of unequal rank, the array having a lower rank is promoted to a higher rank by (virtually) prepending singleton dimensions until the number of dimensions matches that of the array having a higher rank.
2121

22-
The results of the element-wise operation must be stored in an array having a shape determined by the following algorithm.
22+
The results of the element-wise operation *must* be stored in an array having a shape determined by the following algorithm.
2323

2424
#. Let ``A`` and ``B`` both be arrays.
2525

@@ -112,7 +112,7 @@ The following examples demonstrate array shapes which do **not** broadcast.
112112
In-place Semantics
113113
------------------
114114

115-
As implied by the broadcasting algorithm, in-place element-wise operations (including ``__setitem__``) must not change the shape of the in-place array as a result of broadcasting. Such operations should only be supported in the case where the right-hand operand can broadcast to the shape of the left-hand operand, after any indexing operations are performed.
115+
As implied by the broadcasting algorithm, in-place element-wise operations (including ``__setitem__``) *must not* change the shape of the in-place array as a result of broadcasting. Such operations should only be supported in the case where the right-hand operand can broadcast to the shape of the left-hand operand, after any indexing operations are performed.
116116

117117
For example:
118118

Diff for: spec/draft/API_specification/constants.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ Constants
33

44
Array API specification for constants.
55

6-
A conforming implementation of the array API standard must provide and support the following constants adhering to the following conventions.
6+
A conforming implementation of the array API standard *must* provide and support the following constants adhering to the following conventions.
77

8-
- Each constant must have a Python floating-point data type (i.e., ``float``) and be provided as a Python scalar value.
8+
- Each constant *must* have a Python floating-point data type (i.e., ``float``) and be provided as a Python scalar value.
99

1010
Objects in API
1111
--------------

Diff for: spec/draft/API_specification/creation_functions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Creation Functions
33

44
Array API specification for creating arrays.
55

6-
A conforming implementation of the array API standard must provide and support the following functions.
6+
A conforming implementation of the array API standard *must* provide and support the following functions.
77

88

99
Objects in API

Diff for: spec/draft/API_specification/data_type_functions.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Data Type Functions
33

44
Array API specification for data type functions.
55

6-
A conforming implementation of the array API standard must provide and support the following data type functions.
6+
A conforming implementation of the array API standard *must* provide and support the following data type functions.
77

88

99
Objects in API

Diff for: spec/draft/API_specification/data_types.rst

+11-11
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Data Types
55

66
Array API specification for supported data types.
77

8-
A conforming implementation of the array API standard must provide and support
8+
A conforming implementation of the array API standard *must* provide and support
99
the following data types ("dtypes") in its array object, and as data type
1010
objects in its main namespace under the specified names:
1111

@@ -34,12 +34,12 @@ objects in its main namespace under the specified names:
3434
+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
3535
| float64 | IEEE 754 double-precision (64-bit) binary floating-point number (see IEEE 754-2019). |
3636
+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
37-
| complex64 | Single-precision (64-bit) complex floating-point number whose real and imaginary components must be IEEE 754 single-precision (32-bit) binary floating-point numbers (see IEEE 754-2019). |
37+
| complex64 | Single-precision (64-bit) complex floating-point number whose real and imaginary components *must* be IEEE 754 single-precision (32-bit) binary floating-point numbers (see IEEE 754-2019). |
3838
+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
39-
| complex128 | Double-precision (128-bit) complex floating-point number whose real and imaginary components must be IEEE 754 double-precision (64-bit) binary floating-point numbers (see IEEE 754-2019). |
39+
| complex128 | Double-precision (128-bit) complex floating-point number whose real and imaginary components *must* be IEEE 754 double-precision (64-bit) binary floating-point numbers (see IEEE 754-2019). |
4040
+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
4141

42-
Data type objects must have the following methods (no attributes are required):
42+
Data type objects *must* have the following methods (no attributes are required):
4343

4444
..
4545
NOTE: please keep the functions in alphabetical order
@@ -89,28 +89,28 @@ See :ref:`type-promotion` for specification guidance describing the rules govern
8989
Default Data Types
9090
------------------
9191

92-
A conforming implementation of the array API standard must define the following default data types.
92+
A conforming implementation of the array API standard *must* define the following default data types.
9393

9494
- a default real-valued floating-point data type (either ``float32`` or ``float64``).
9595
- a default complex floating-point data type (either ``complex64`` or ``complex128``).
9696
- a default integer data type (either ``int32`` or ``int64``).
9797
- a default array index data type (either ``int32`` or ``int64``).
9898

99-
The default real-valued floating-point and complex floating-point data types must be the same across platforms.
99+
The default real-valued floating-point and complex floating-point data types *must* be the same across platforms.
100100

101-
The default complex floating-point point data type should match the default real-valued floating-point data type. For example, if the default real-valued floating-point data type is ``float32``, the default complex floating-point data type must be ``complex64``. If the default real-valued floating-point data type is ``float64``, the default complex floating-point data type must be ``complex128``.
101+
The default complex floating-point point data type *should* match the default real-valued floating-point data type. For example, if the default real-valued floating-point data type is ``float32``, the default complex floating-point data type *must* be ``complex64``. If the default real-valued floating-point data type is ``float64``, the default complex floating-point data type *must* be ``complex128``.
102102

103-
The default integer data type should be the same across platforms, but the default may vary depending on whether Python is 32-bit or 64-bit.
103+
The default integer data type *should* be the same across platforms, but the default may vary depending on whether Python is 32-bit or 64-bit.
104104

105-
The default array index data type may be ``int32`` on 32-bit platforms, but the default should be ``int64`` otherwise.
105+
The default array index data type may be ``int32`` on 32-bit platforms, but the default *should* be ``int64`` otherwise.
106106

107107
Note that it is possible that a library supports multiple devices, with not all
108108
those device types supporting the same data types. In this case, the default
109109
integer or floating-point data types may vary with device. If that is the case,
110-
the library should clearly warn about this in its documentation.
110+
the library *should* clearly warn about this in its documentation.
111111

112112
.. note::
113-
The default data types should be clearly defined in a conforming library's documentation.
113+
The default data types *should* be clearly defined in a conforming library's documentation.
114114

115115

116116
.. _data-type-categories:

Diff for: spec/draft/API_specification/function_and_method_signatures.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Function and method signatures
55

66
Function signatures in this standard adhere to the following:
77

8-
1. Positional parameters should be `positional-only <https://www.python.org/dev/peps/pep-0570/>`_ parameters.
8+
1. Positional parameters *should* be `positional-only <https://www.python.org/dev/peps/pep-0570/>`_ parameters.
99
Positional-only parameters have no externally-usable name. When a function
1010
accepting positional-only parameters is called, positional arguments are
1111
mapped to these parameters based solely on their order.
@@ -20,7 +20,7 @@ Function signatures in this standard adhere to the following:
2020
namespace >= 3.8. Alternatively, they can add guidance to their users in the
2121
documentation to use the functions as if they were positional-only.
2222

23-
2. Optional parameters should be `keyword-only <https://www.python.org/dev/peps/pep-3102/>`_ arguments.
23+
2. Optional parameters *should* be `keyword-only <https://www.python.org/dev/peps/pep-3102/>`_ arguments.
2424

2525
*Rationale: this leads to more readable code, and it makes it easier to
2626
evolve an API over time by adding keywords without having to worry about

Diff for: spec/draft/API_specification/index.rst

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
API specification
44
=================
55

6-
A conforming implementation of the array API standard must provide and support the APIs and behavior detailed in this specification while adhering to the following conventions.
6+
A conforming implementation of the array API standard *must* provide and support the APIs and behavior detailed in this specification while adhering to the following conventions.
77

8-
- When a function signature includes a `/`, positional parameters must be `positional-only <https://www.python.org/dev/peps/pep-0570/>`_ parameters. See :ref:`function-and-method-signatures`.
9-
- When a function signature includes a `*`, optional parameters must be `keyword-only <https://www.python.org/dev/peps/pep-3102/>`_ arguments. See :ref:`function-and-method-signatures`.
10-
- Broadcasting semantics must follow the semantics defined in :ref:`broadcasting`.
11-
- Unless stated otherwise, functions must support the data types defined in :ref:`data-types`.
8+
- When a function signature includes a `/`, positional parameters *must* be `positional-only <https://www.python.org/dev/peps/pep-0570/>`_ parameters. See :ref:`function-and-method-signatures`.
9+
- When a function signature includes a `*`, optional parameters *must* be `keyword-only <https://www.python.org/dev/peps/pep-3102/>`_ arguments. See :ref:`function-and-method-signatures`.
10+
- Broadcasting semantics *must* follow the semantics defined in :ref:`broadcasting`.
11+
- Unless stated otherwise, functions *must* support the data types defined in :ref:`data-types`.
1212
- Functions may only be required for a subset of input data types. Libraries may choose to implement functions for additional data types, but that behavior is not required by the specification. See :ref:`data-type-categories`.
13-
- Unless stated otherwise, functions must adhere to the type promotion rules defined in :ref:`type-promotion`.
14-
- Unless stated otherwise, floating-point operations must adhere to IEEE 754-2019.
15-
- Unless stated otherwise, element-wise mathematical functions must satisfy the minimum accuracy requirements defined in :ref:`accuracy`.
13+
- Unless stated otherwise, functions *must* adhere to the type promotion rules defined in :ref:`type-promotion`.
14+
- Unless stated otherwise, floating-point operations *must* adhere to IEEE 754-2019.
15+
- Unless stated otherwise, element-wise mathematical functions *must* satisfy the minimum accuracy requirements defined in :ref:`accuracy`.
1616

1717

1818
.. toctree::

0 commit comments

Comments
 (0)