summaryrefslogtreecommitdiff
path: root/numpy/array_api
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #21120 from BvB93/matmulMatti Picus2023-03-261-12/+2
|\ | | | | ENH: Add support for inplace matrix multiplication
| * MAINT: Let `ndarray.__imatmul__` handle inplace matrix multiplication in the ↵Bas van Beek2022-12-021-12/+2
| | | | | | | | array-api
* | MAINT: cleanup unused Python3.8-only code and referencesClément Robert2023-03-141-17/+14
| |
* | rename test functionAlex Rogozhnikov2023-02-261-1/+1
| |
* | add support for xp.takeAlex Rogozhnikov2023-02-263-0/+46
| |
* | TYP,MAINT: Add a missing explicit Any parameterFrancesc Elies2023-02-211-1/+1
| |
* | DOC: Some updates to the array_api compat document (#22747)Aaron Meurer2022-12-061-0/+1
|/ | | | | | | * Add reshape differences to the array API compat document * Add an item to the array API compat document about reverse broadcasting * Make some wording easier to read
* Add `__array_api_version__` to `numpy.array_api` namespaceMatthew Barber2022-10-021-1/+3
|
* TST: Move new `asarray` test to a more appropriate place. (#22251)M. Eric Irrgang2022-09-131-64/+0
| | | | | | | | | | | | | As noted at #21995 (comment), the new test from #21995 was placed in a directory intended for the Array API, and unrelated to the change. * Consolidate test_dtype_identity into an existing test file. Remove `test_asarray.py`. Create a new `TestAsArray` suite in `test_array_coercion.py` * Linting. Wrap some comments that got too long after function became a method (with additional indentation).
* Merge pull request #21995 from eirrgang/mei-1468Matti Picus2022-09-071-0/+64
|\ | | | | BUG: Distinguish exact vs. equivalent dtype for C type aliases.
| * Add release note and further clarify tests.M. Eric Irrgang2022-07-171-12/+31
| |
| * Lint.M. Eric Irrgang2022-07-171-3/+4
| | | | | | | | Shorten some lines.
| * Expand test_asarray.py.M. Eric Irrgang2022-07-171-13/+33
| | | | | | | | | | | | | | * Improve comments/docs. * Improve descriptiveness of variable names. * Add additional test expressions that would not pass without this patch.
| * Update comment and obey formatting requirements.M. Eric Irrgang2022-07-161-2/+2
| |
| * Add unit testing.M. Eric Irrgang2022-07-161-0/+24
| |
* | BUG: Fix the implementation of numpy.array_api.vecdot (#21928)Aaron Meurer2022-09-071-1/+12
| | | | | | | | | | | | | | * Fix the implementation of numpy.array_api.vecdot See https://data-apis.org/array-api/latest/API_specification/generated/signatures.linear_algebra_functions.vecdot.html * Use moveaxis + matmul instead of einsum in vecdot
* | MAINT: fix typo in test_array_object test description (#22071)Ikko Ashimine2022-08-021-1/+1
|/
* MAINT: Fix computation of numpy.array_api.linalg.vector_norm (#21084)Aaron Meurer2022-06-151-8/+31
| | | | | | | | | | | | | | | | | | * Fix computation of numpy.array_api.linalg.vector_norm Various pieces were incorrect due to a lack of complete coverage of this function in the array API test suite. * Fix the output dtype nonstandard vector norm() Previously it would always give float64 because an internal calculation involved a NumPy scalar and a Python float. The fix is to use a 0-D array instead of a NumPy scalar so that it type promotes with the float correctly. Fixes #21083 I don't have a test for this yet because I'm unclear how exactly to test it. * Clean up the numpy.array_api.linalg.vector_norm code a little bit
* Fix the array API unique_*() functions to not compare nans as equalAaron Meurer2022-06-031-0/+4
| | | | | The spec requires this, but it is only now possible to implement with the new equal_nan flag in np.unique().
* API: Allow newaxis indexing for `array_api` arrays (#21377)Matthew Barber2022-05-062-99/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* Fix a type hint in numpy.array_apiAaron Meurer2022-03-281-1/+1
|
* Add some missing notes to array_apiAaron Meurer2022-03-281-1/+2
|
* Properly restrict the input dtypes for the array_api trace, svdvals, and vecdotAaron Meurer2022-03-281-0/+6
|
* Remove some outdated commentsAaron Meurer2022-03-281-2/+0
|
* Update some Note comments in numpy.array_apiAaron Meurer2022-03-282-1/+7
|
* MAINT: make np._from_dlpack publicTirth Patel2022-03-031-1/+1
|
* Note `np.array_api.can_cast()` does not use `np.can_cast()`Matthew Barber2022-02-092-2/+5
|
* BUG: Fix `np.array_api.can_cast()` by not relying on `np.can_cast()`Matthew Barber2022-02-093-4/+58
|
* Regression test for inverse indices in `array_api` set functionsMatthew2022-01-131-0/+19
|
* BUG: Return correctly shaped inverse indices in `array_api`Matthew2022-01-131-5/+15
| | | | Specifically for `xp.unique_all()` and `xp.unique_inverse()`
* Merge pull request #20762 from honno/xp-pow-fixesCharles Harris2022-01-124-12/+10
|\ | | | | BUG: Allow integer inputs for pow-related functions in `array_api`
| * BUG: Allow integer inputs for pow-related functions in `array_api`Matthew2022-01-074-12/+10
| | | | | | | | Updates `xp.power()`, `x.__pow__()`, `x.__ipow()__` and `x.__rpow()__`
* | BUG: `array_api.argsort(descending=True)` respects relative sort order (#20788)Matthew Barber2022-01-122-3/+37
|/ | | | | * BUG: `array_api.argsort(descending=True)` respects relative order * Regression test for stable descending `array_api.argsort()`
* Merge pull request #20720 from rgommers/arrayapi-annotation-fixesMatti Picus2022-01-041-2/+3
|\ | | | | TYP: add a few type annotations to `numpy.array_api.Array`
| * TYP: accept review comment on ignoring NotImplemented in type checkingRalf Gommers2022-01-041-4/+1
| | | | | | Co-authored-by: Bas van Beek <43369155+BvB93@users.noreply.github.com>
| * TYP: add a few type annotations to `numpy.array_api.Array`Ralf Gommers2022-01-031-1/+5
| | | | | | | | | | | | | | | | | | This fixes the majority of the complaints for `$ mypy numpy/array_api`. The comment indicating that one fix is blocked by lack of support in Mypy for `NotImplemented` is responsible for another several dozen errors. [skip ci]
* | TYP: change type annotation for `__array_namespace__` to ModuleTypeRalf Gommers2022-01-031-1/+2
|/ | | | | | This is more precise, we are returning a module here. Type checkers will be able to use this info in the future - see https://github.com/data-apis/array-api/issues/267
* Merge pull request #20533 from asmeurer/array_api-prod-fixCharles Harris2021-12-071-2/+2
|\ | | | | BUG: Fix handling of the dtype parameter to numpy.array_api.prod()
| * BUG: Fix handling of the dtype parameter to numpy.array_api.prod()Aaron Meurer2021-12-071-2/+2
| |
* | Add type hints to the numpy.array_api.Array.__array__ signatureAaron Meurer2021-12-061-1/+2
| | | | | | | | Thanks @BvB93
* | ENH: Add __array__ to the array_api Array objectAaron Meurer2021-12-062-0/+18
|/ | | | | | | | | | | This is *NOT* part of the array API spec (so it should not be relied on for portable code). However, without this, np.asarray(np.array_api.Array) produces an object array instead of doing the conversion to a NumPy array as expected. This would work once np.asarray() implements dlpack support, but until then, it seems reasonable to make the conversion work. Note that the reverse, calling np.array_api.asarray(np.array), already works because np.array_api.asarray() is just a wrapper for np.asarray().
* Add tests for T and mT in array_apiAaron Meurer2021-12-011-0/+14
|
* BUG: Fix the .T attribute in the array_api namespaceAaron Meurer2021-12-011-1/+1
| | | | Fixes #20498.
* Merge pull request #19173 from czgdp1807/never_copyMatti Picus2021-11-152-8/+14
|\ | | | | ENH: Add support for copy modes to NumPy
| * Merge branch 'main' into never_copyRalf Gommers2021-11-128-44/+162
| |\
| * \ resolved conflictsGagandeep Singh2021-11-0210-51/+192
| |\ \
| * | | Addressed reviewsczgdp18072021-09-042-4/+4
| | | |
| * | | fixed linting issuesczgdp18072021-09-031-2/+2
| | | |
| * | | fixed linting issuesczgdp18072021-09-031-1/+2
| | | |
| * | | CopyMode added to np.array_apiczgdp18072021-09-032-6/+11
| | | |