Skip to content

Commit 9117492

Browse files
authored
Add a note on adding complex64/128 in a future version (#105)
This introduces a new "Future extension" admonition, which uses the MyST "colon fence" (requires a newer version of MyST). Closes gh-102
1 parent f12cb77 commit 9117492

File tree

3 files changed

+24
-22
lines changed

3 files changed

+24
-22
lines changed

spec/API_specification/data_types.md

+23-22
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,11 @@
66
77
A conforming implementation of the array API standard must provide and support the following data types.
88

9-
```{note}
10-
11-
Data types ("dtypes") are objects that can be used as `dtype` specifiers in functions and methods (e.g., `zeros((2, 3), dtype=float32)`). A conforming implementation may add methods or attributes to data type objects; however, these methods and attributes are not included in this specification.
12-
```
13-
14-
```{note}
15-
16-
Implementations may provide other ways to specify data types (e.g.,
17-
`zeros((2, 3), dtype='f4')`); however, these are not included in this specification.
18-
```
19-
20-
A conforming implementation of the array API standard may provide and support additional data types beyond those described in this specification.
21-
22-
A conforming implementation of the array API standard must define a default floating-point data type (either `float32` or `float64`).
9+
A conforming implementation of the array API standard must define a default floating-point data type (either `float32` or `float64`), as well as a default data type for an array index (either `int32` or `int64`).
2310

2411
```{note}
2512
26-
The default floating-point data type should be clearly defined in a conforming library's documentation.
27-
```
28-
29-
A conforming implementation of the array API standard must define a default data type for an array index (either `int32` or `int64`).
30-
31-
```{note}
32-
33-
The default array index data type should be clearly defined in a conforming library's documentation.
13+
The default floating-point and array index integer data types should be clearly defined in a conforming library's documentation.
3414
```
3515

3616

@@ -77,3 +57,24 @@ IEEE 754 single-precision (32-bit) binary floating-point number (see IEEE 754-20
7757
## float64
7858

7959
IEEE 754 double-precision (64-bit) binary floating-point number (see IEEE 754-2019).
60+
61+
62+
:::{admonition} Future extension
63+
:class: hint
64+
It is expected that in the next version of this standard, `complex64` and `complex128`
65+
dtypes will be added, with these casting rules (will be added to {ref}`type-promotion`):
66+
67+
![Type promotion diagram for complex dtypes in next version](/_static/images/dtype_promotion_complex.png)
68+
69+
See [array-api/issues/102](https://github.com/data-apis/array-api/issues/102)
70+
for more details.
71+
:::
72+
73+
```{note}
74+
Data types ("dtypes") are objects that can be used as `dtype` specifiers in functions and methods (e.g., `zeros((2, 3), dtype=float32)`). A conforming implementation may add methods or attributes to data type objects; however, these methods and attributes are not included in this specification.
75+
76+
Implementations may provide other ways to specify data types (e.g.,
77+
`zeros((2, 3), dtype='f4')`); however, these are not included in this specification.
78+
79+
A conforming implementation of the array API standard may provide and support additional data types beyond those described in this specification.
80+
```
10.2 KB
Loading

spec/conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050

5151
# MyST options
5252
myst_heading_anchors = 3
53+
myst_enable_extensions = ["colon_fence"]
5354

5455
# -- Options for HTML output -------------------------------------------------
5556

0 commit comments

Comments
 (0)