diff options
author | Matthew Barber <quitesimplymatt@gmail.com> | 2022-05-06 09:27:27 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-06 11:27:27 +0200 |
commit | befef7b26773eddd2b656a3ab87f504e6cc173db (patch) | |
tree | 95c9ea72750052d759f87f35abe43019f0478b71 /numpy/array_api/tests/test_creation_functions.py | |
parent | ba54f569cecf17812695f17812d238af2bb91000 (diff) | |
download | numpy-befef7b26773eddd2b656a3ab87f504e6cc173db.tar.gz |
API: Allow newaxis indexing for `array_api` arrays (#21377)
* TST: Add test checking if newaxis indexing works for `array_api`
Also removes previous check against newaxis indexing, which is now outdated
* TST, BUG: Allow `None` in `array_api` indexing
Introduces test for validating flat indexing when `None` is present
* MAINT,DOC,TST: Rework of `_validate_index()` in `numpy.array_api`
_validate_index() is now called as self._validate_index(shape), and does not
return a key. This rework removes the recursive pattern used. Tests are
introduced to cover some edge cases. Additionally, its internal docstring
reflects new behaviour, and extends the flat indexing note.
* MAINT: `advance` -> `advanced` (integer indexing)
Co-authored-by: Aaron Meurer <asmeurer@gmail.com>
* BUG: array_api arrays use internal arrays from array_api array keys
When an array_api array is passed as the key for get/setitem, we access the
key's internal np.ndarray array to be used as the key for the internal
get/setitem operation. This behaviour was initially removed when
`_validate_index()` was reworked.
* MAINT: Better flat indexing error message for `array_api` arrays
Also better semantics for its prior ellipsis count condition
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
* MAINT: `array_api` arrays don't special case multi-ellipsis errors
This gets handled by NumPy-proper.
Co-authored-by: Aaron Meurer <asmeurer@gmail.com>
Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
Diffstat (limited to 'numpy/array_api/tests/test_creation_functions.py')
0 files changed, 0 insertions, 0 deletions