-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add support for Array API in NamedArray #8344
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
Draft
Illviljan
wants to merge
563
commits into
pydata:main
Choose a base branch
from
Illviljan:add_array_api_mean
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 183 commits
Commits
Show all changes
563 commits
Select commit
Hold shift + click to select a range
4fa029b
Merge branch 'main' into add_array_api_mean
Illviljan b1ad54c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 9657bf2
Merge branch 'add_array_api_mean' of https://github.com/Illviljan/xar…
Illviljan 63db063
Update _typing.py
Illviljan e810921
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] d9b516d
Update _creation_functions.py
Illviljan 686ef2b
Update _data_type_functions.py
Illviljan 937724d
Update _linear_algebra_functions.py
Illviljan 28dde6a
Update _set_functions.py
Illviljan 9354771
Update _typing.py
Illviljan ee12ae5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 4de05f8
Using operators instead should handle inplace methods missing
Illviljan 0328e44
Update _indexing_functions.py
Illviljan 7f9c8bb
Update core.py
Illviljan 6014235
Update _utils.py
Illviljan 117548d
Update _utils.py
Illviljan 64278e5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 783be0d
Update _utils.py
Illviljan 652097b
Merge branch 'add_array_api_mean' of https://github.com/Illviljan/xar…
Illviljan 5ce92c9
Update core.py
Illviljan 1ba871a
Merge branch 'main' into add_array_api_mean
Illviljan de99d36
skip cumulative sum
Illviljan 1835514
Update _typing.py
Illviljan 68c271c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 92ee203
Update _typing.py
Illviljan e70fee7
Merge branch 'add_array_api_mean' of https://github.com/Illviljan/xar…
Illviljan 019a610
Update core.py
Illviljan 6e7de32
Update core.py
Illviljan c302e65
Update core.py
Illviljan ad6d7e4
Update _utils.py
Illviljan 8fa6d58
Update _manipulation_functions.py
Illviljan b65de7a
Update _manipulation_functions.py
Illviljan 0d0ea3b
normalize negative values to positive
Illviljan 52343d9
more tests and fixes to broadcasted dims
Illviljan 5e3da64
Add dims for basic array creation
Illviljan f45429d
add examples
Illviljan 7efcef2
add dim keywords
Illviljan 04b01b3
Update _manipulation_functions.py
Illviljan 4a97364
Add arithmetic broadcasting
Illviljan f4f3268
Use arithmetic broadcasting
Illviljan 656ab62
Add doctests
Illviljan 95f8490
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] b9e6457
Merge branch 'main' into add_array_api_mean
Illviljan 9d4b9d2
Update _utils.py
Illviljan f64f967
reflexive should broadcast as well
Illviljan 5540702
typing
Illviljan b269650
Handle unordered dims
Illviljan 218eba1
Update _manipulation_functions.py
Illviljan 8ee6172
subclasses needs to be passed down
Illviljan 90e4819
prioritize variable arithmetics
Illviljan c295100
Update indexing.py
Illviljan d02f4f2
add copy to __array__
Illviljan 825805b
calculate dims from tuple indexing
Illviljan e29287d
Handle getitem better
Illviljan 28df307
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] eb73c2d
Update _utils.py
Illviljan a450e8a
Update core.py
Illviljan 30a4fea
Merge branch 'main' into add_array_api_mean
Illviljan 9c3f6c1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 73a7d2f
improve dims handling
Illviljan e947757
Merge branch 'add_array_api_mean' of https://github.com/Illviljan/xar…
Illviljan 45c6db0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] e90508e
typo
Illviljan 93933d6
Merge branch 'add_array_api_mean' of https://github.com/Illviljan/xar…
Illviljan de0aa20
Update _utils.py
Illviljan 17346f7
Update indexing.py
Illviljan 1173cc0
Update indexing.py
Illviljan 8a5a041
Update _manipulation_functions.py
Illviljan fae50aa
add examples
Illviljan 52f7edf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 805a0c5
Update _manipulation_functions.py
Illviljan 4621e26
Clarify the paths
Illviljan f6e90d0
Shorten name
Illviljan 31ef484
Add atleast1d for dims, unique_values seems to need it
Illviljan c049f98
unique_values is atleast1d
Illviljan 749235b
Update _manipulation_functions.py
Illviljan c77feb1
Update core.py
Illviljan fe17279
Merge branch 'main' into add_array_api_mean
Illviljan 00115d1
Update _set_functions.py
Illviljan 6cf9fae
Update _set_functions.py
Illviljan 18400d5
indexing are always 1d?
Illviljan 842b289
0D concatenation
Illviljan 733a45a
lets try reshape again
Illviljan b7ceeb4
Update _utils.py
Illviljan 43f757e
Ellipsis are often converted to slices
Illviljan e8b2b4e
Convert ellipsis to slices
Illviljan ec3880e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 4431175
Update _manipulation_functions.py
Illviljan a86d900
Merge branch 'add_array_api_mean' of https://github.com/Illviljan/xar…
Illviljan 1267750
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 5bafb8c
Try simplify mean
Illviljan 7c278dc
Merge branch 'add_array_api_mean' of https://github.com/Illviljan/xar…
Illviljan c59fb54
Seems successfull do it on the rest
Illviljan 889feaa
more places to simplify
Illviljan f6ffdaf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 793d166
squeeze
Illviljan 4ef9e1c
Merge branch 'add_array_api_mean' of https://github.com/Illviljan/xar…
Illviljan 353d8bf
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 0f26d51
Update _utils.py
Illviljan 2cec2c7
typing
Illviljan c5a3054
Update _utils.py
Illviljan e3923f4
matrix_transpose
Illviljan b8c4ba5
Merge branch 'main' into add_array_api_mean
Illviljan 31d8882
Update _linear_algebra_functions.py
Illviljan 0c83ff6
simplify function names
Illviljan 27ebb03
vecdot
Illviljan 0022d04
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] b7d734a
Use normal repr
Illviljan 1891a6c
Normal repr
Illviljan e77d38d
Merge branch 'main' into add_array_api_mean
Illviljan 26de5e4
Update _statistical_functions.py
Illviljan 5496da9
Update _linear_algebra_functions.py
Illviljan 6499fb7
Update _set_functions.py
Illviljan 4dba4bf
flip
Illviljan 930c485
moveaxis
Illviljan 2a83e70
repeat
Illviljan ef2843c
Update _manipulation_functions.py
Illviljan 649118a
Update _manipulation_functions.py
Illviljan d7adbd8
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] e88af20
roll
Illviljan 557f654
Update _utils.py
Illviljan 8c1c970
Update _utils.py
Illviljan 19e1923
arange
Illviljan 1844721
asarray
Illviljan 22ed956
asarray
Illviljan 02c1aa7
empty
Illviljan 5f293b0
empty_like
Illviljan 2e89630
eye
Illviljan e94ed05
Update _creation_functions.py
Illviljan 468c90d
from_dlpack
Illviljan 38b0c4b
full
Illviljan 4163297
Update _creation_functions.py
Illviljan bbac8eb
full_like
Illviljan bab4856
linspace
Illviljan f01159c
Merge branch 'main' into add_array_api_mean
Illviljan 20498ff
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 3a0941c
meshgrid
Illviljan 11e02c4
ones
Illviljan 14108e2
ones_like
Illviljan ce633a8
tril
Illviljan 8307e3e
triu
Illviljan 69bd690
zeros
Illviljan b24d3b5
zeros_like
Illviljan d8a955f
Merge branch 'main' into add_array_api_mean
Illviljan 0856ccb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 7ae8e68
Update core.py
Illviljan e8131ce
Update _utils.py
Illviljan 437b3e0
all
Illviljan 38cff61
any
Illviljan f7e870c
diff
Illviljan 7d9918c
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] befb4fe
Merge branch 'main' into add_array_api_mean
Illviljan 05c2b78
handle 0 dim arrays in meshgrid
Illviljan 1fdcea4
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] ceb2b87
Merge branch 'main' into add_array_api_mean
Illviljan ad46646
Merge branch 'main' into add_array_api_mean
Illviljan 04648ca
Merge branch 'main' into add_array_api_mean
Illviljan 9c98af8
Update _typing.py
Illviljan 3f22432
Merge branch 'main' into add_array_api_mean
Illviljan 010b2a1
add Anys
Illviljan 2257829
docstring _isnone
Illviljan 6f2d765
Update _utils.py
Illviljan 9e8bcca
matmul docs and fixes
Illviljan 53cda6f
Merge branch 'main' into add_array_api_mean
Illviljan a064865
Merge branch 'main' into add_array_api_mean
Illviljan da45147
Merge branch 'main' into add_array_api_mean
Illviljan 66f6f81
Move to 2024.12 spec
Illviljan 9101592
Handle RUF022
Illviljan 75191bc
Handle F401, A thin wrapper for a future rework
Illviljan 76472a8
Update __init__.py
Illviljan bef24bd
Update _linalg.py
Illviljan 0765a45
2024.12 - Add dtype kwarg
Illviljan d80dcfa
Add count_nonzero
Illviljan dfe57f0
Add docstring
Illviljan c23b89a
Update __init__.py
Illviljan 640fca6
Update array-api-tests.yml
Illviljan 1c6b34e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] ba044f7
_datas not good enough grammar...
Illviljan 675306a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 3d192de
_datas not good enough grammar...
Illviljan 1d7d5de
Merge branch 'add_array_api_mean' of https://github.com/Illviljan/xar…
Illviljan 83f38d5
_datas not good enough grammar...
Illviljan 8f46274
Newer python version
Illviljan 5f02c5a
Add cumulative_prod
Illviljan c389c00
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 951e7bc
less examples to speed up ci
Illviljan 4b1ccf5
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 6b2f9ec
Add nextafter
Illviljan 28e3d11
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] e132465
Add diff
Illviljan 8234cb5
Update __init__.py
Illviljan a3eba94
Merge branch 'add_array_api_mean' of https://github.com/Illviljan/xar…
Illviljan 5270e5d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] d360c13
Update _utility_functions.py
Illviljan c7ffa51
Merge branch 'add_array_api_mean' of https://github.com/Illviljan/xar…
Illviljan fb45da6
Add reciprocal
Illviljan 1361e1f
Add take_along_axis
Illviljan 2412c94
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] ec75d7f
Add max rank
Illviljan 7b016b1
Merge branch 'add_array_api_mean' of https://github.com/Illviljan/xar…
Illviljan e0f6a2a
fix nextafter
Illviljan 2825ed4
numpy (r)fftfreq does not support dtype yet
Illviljan f901017
np does not support arrays for iinfo finfo
Illviljan 9af7d0c
Merge branch 'main' into add_array_api_mean
Illviljan a78cb25
alphabetical order
Illviljan cc65e76
Handle scalars in result_type
Illviljan 0c70f44
Add _promote_scalar
Illviljan 4557c98
Add _promote_scalars
Illviljan c9659b3
Add scalars to elementwise functions
Illviljan 2c1b7d5
Merge branch 'main' into add_array_api_mean
Illviljan 16bb6dd
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] bfd6609
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 7012c4b
types are not the same, start with all available and reduce
Illviljan 8058c12
Update _data_type_functions.py
Illviljan fc0d5eb
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 2ebf9f3
Update _data_type_functions.py
Illviljan b8ce982
Merge branch 'add_array_api_mean' of https://github.com/Illviljan/xar…
Illviljan 07c7021
Update _elementwise_functions.py
Illviljan a733610
the functions handles scalars now
Illviljan 8a6f7ea
Fix __radd__ issues
Illviljan f8231a9
Handle iadd
Illviljan 8a3b97c
Update core.py
Illviljan dcbb9d3
Revert "Update core.py"
Illviljan 040ed9f
Update core.py
Illviljan e61602e
Handle setitem
Illviljan 633eb5c
skip test_finfo[complex64]
Illviljan 2fafddb
Update _typing.py
Illviljan aac836e
Handle setitem
Illviljan 8de9934
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 1a73270
Verboser loggs, very annoying not seeing the inputs for the tests.
Illviljan c0bac13
Merge branch 'add_array_api_mean' of https://github.com/Illviljan/xar…
Illviljan 26a683d
Merge branch 'main' into add_array_api_mean
Illviljan ed5ecc7
sum: add dtype
Illviljan 6f138ab
Update _utils_inputs.py
Illviljan 0aeab44
Update core.py
Illviljan 529462c
Add support for indexing arrays in tuple indexing
Illviljan 91fbeca
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] a7cdab5
Merge branch 'main' into add_array_api_mean
Illviljan 0229573
Merge branch 'main' into add_array_api_mean
Illviljan aef66ab
Merge branch 'main' into add_array_api_mean
Illviljan b8106f2
Try to handle integer arrays in indexing
Illviljan 2e8aba5
Merge branch 'main' into add_array_api_mean
Illviljan c8bc9ea
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 80923ba
correct axis_default kwarg
Illviljan 3e30dc8
Update _indexing_functions.py
Illviljan 8be7897
where: condition is always an array
Illviljan c266434
Update _searching_functions.py
Illviljan 344a56e
Merge branch 'main' into add_array_api_mean
Illviljan a45340f
default_device is a function
Illviljan a54c12b
Add max dimensions
Illviljan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: NamedArray._array_api | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
PYTEST_ARGS: "-v -rxXfE --ci --hypothesis-disable-deadline --max-examples 5" | ||
API_VERSIONS: "2023.12" | ||
|
||
jobs: | ||
array-api-tests: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: ['3.12'] | ||
exclude: | ||
- python-version: '3.8' | ||
|
||
steps: | ||
- name: Checkout xarray | ||
uses: actions/checkout@v4 | ||
with: | ||
path: xarray | ||
- name: Checkout array-api-tests | ||
uses: actions/checkout@v4 | ||
with: | ||
repository: data-apis/array-api-tests | ||
submodules: 'true' | ||
path: array-api-tests | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install Dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
python -m pip install ${GITHUB_WORKSPACE}/xarray | ||
python -m pip install -r ${GITHUB_WORKSPACE}/array-api-tests/requirements.txt | ||
python -m pip install hypothesis | ||
python -m pip install array-api-strict | ||
python -m pip install array-api-compat | ||
- name: Run the array API testsuite | ||
env: | ||
ARRAY_API_TESTS_MODULE: xarray.namedarray._array_api | ||
run: | | ||
cd ${GITHUB_WORKSPACE}/array-api-tests | ||
pytest array_api_tests/ --skips-file ${GITHUB_WORKSPACE}/xarray/xarray/tests/namedarray_array_api_skips.txt ${PYTEST_ARGS} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.