8000 Update formatting and organization of dtype guidance by kgryte · Pull Request #206 · data-apis/array-api · GitHub
[go: up one dir, main page]

Skip to content

Update formatting and organization of dtype guidance #206

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 27, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 27 additions & 13 deletions spec/API_specification/data_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@

A conforming implementation of the array API standard must provide and support the following data types.

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 integer data type (`int32` or `int64`). These default data types must be the same across platforms. The default integer data type may vary depending on whether Python is 32-bit or 64-bit.

```{note}
The default floating-point and array index integer data types should be clearly defined in a conforming library's documentation.
```


## bool

Boolean (`True` or `False`).
Expand Down Expand Up @@ -60,8 +53,9 @@ IEEE 754 double-precision (64-bit) binary floating-point number (see IEEE 754-20

:::{admonition} Future extension
:class: hint
It is expected that in the next version of this standard, `complex64` and `complex128`
dtypes will be added, with these casting rules (will be added to {ref}`type-promotion`):
`complex64` and `complex128` dtypes are expected to be included in the next
version of this standard and to have the following casting rules (will be added
to {ref}`type-promotion`):

![Type promotion diagram for complex dtypes in next version](/_static/images/dtype_promotion_complex.png)

Expand All @@ -78,13 +72,33 @@ Implementations may provide other ways to specify data types (e.g.,
A conforming implementation of the array API standard may provide and support additional data types beyond those described in this specification.
```

(data-type-defaults)=
## Default Data Types

A conforming implementation of the array API standard must define a default floating-point data type (either `float32` or `float64`) and a default integer data type (`int32` or `int64`).

The default data types must be the same across platforms.

The default integer data type may vary depending on whether Python is 32-bit or 64-bit.

```{note}
The default floating-point and integer data types should be clearly defined in a conforming library's documentation.
```

(data-type-categories)=
## Data Type Categories

For the purposes of this specification, the following data type categories are defined.
Libraries do not need to organize dtypes according to these categories. These
are only for organizing the functions in this specification itself. Future versions of
the specification will include additional categories for complex data types.
For the purpose of organizing functions within this specification, the following data type categories are 5E83 defined.

```{note}
Conforming libraries are not required to organize dtypes according to these categories. These
categories are only intended for use within this specification.
```

```{note}
Future versions of the specification will include additional categories for
complex data types.
```

### Numeric Data Types

Expand Down
0