data-apis/array-api

Wording in default_dtypes does not leave room for unsupported data types

cbourjau opened this issue · 3 comments

The documentation of default_dtypes reads as of today:

Returns a dictionary containing default data types.

The dictionary must have the following keys:

  - "real floating": default real floating-point data type.

  - "complex floating": default complex floating-point data type.

  - "integral": default integral data type.

  - "indexing": default array index data type.

The "must" poses an issue for implementations that don't implement all data types, yet, such as ndonnx (related discussion). Maybe wording this as "...may at most contain the following keys..." is more appropriate?

So far the standard has required all data types. There was some discussion about loosening this, but I don't remember if there was a resolution on it, or if we actually have an issue for it already.

Oh, I see! Thanks for the clarification! I was under the impression that a subset may be allowed, but it clearly isn't: https://data-apis.org/array-api/2023.12/API_specification/data_types.html. I believe it does indeed make sense to require all data types so I'm closing this issue.

Agreed, for the standard it does make sense; if users can't rely on anything being present then they're forced to write very defensive code.

For the test suite we should have accommodations though, to make it easier to use the test suite when some data types are missing - that has turned out to be very useful so far in testing partial implementations for compliance of the APIs that are present.