Uh oh!
There was an error while loading. Please reload this page.
Add support for Array API in NamedArray - #8344
Conversation
| return out | ||
| # %% Statistical Functions |
There was a problem hiding this comment.
@Illviljan, i'm curious to hear your thoughts on adopting a similar structure/organization as that used in Numpy so as to it easier to incorporate new array API compliant functionality in the future. the new structure would group functionality under /namedarray/_array_api/*.py instead of of putting everything in _array_api.py.
e.g.
├── _creation_functions.py
├── _data_type_functions.py
├── _dtypes.py
├── _elementwise_functions.py
├── _indexing_functions.py
├── _manipulation_functions.py
├── _searching_functions.py
├── _set_functions.py
├── _sorting_functions.py
├── _statistical_functions.py
├── linalg.py
There was a problem hiding this comment.
Sure! I just thought it was too few functions to bother with it right now.
Cubed has similar structure too.
There was a problem hiding this comment.
perfect! i intend to add a few more functions to the array_api and i'm happy to put this structure in place
dcherian
commented
Dec 7, 2023
@Illviljan can you comment on why this approach is useful if we can't advertise array_api compliance based on upstream input? |
Illviljan
commented
Dec 7, 2023
I notice sklearn for example is slowly getting array api support and I think it would be a great win to get these kind of packages to just work out of the box. There's two distinct programming styles between array api vs. xarray:
Due to this, I'm not yet convinced it is impossible for us to not support both. Most stuff xarray do is simply an extension of the narrow array api. Internally we have to deal with array apis and the namedarray imports |
This particular PR has simply grown because of the lack of typing in |
dcherian
commented
Dec 8, 2023
Sure, but the way to proceed would be to build consensus around this in an issue discussion or at the bi-weekly meeting.
For example, this assertion has had very little support within the core team in discussions. |
Illviljan
commented
Dec 9, 2023
It's hard to change peoples mind sometimes, so I like to have some working examples for discussion.
Still, there is It is the only way to be compliant to both ways and xarray in general seem to enjoy the method-chaining style more. So adding array_api compatible equivalents wont change current workflows much but will however allow considerable more workflows automatically. Being able to pass around attrs and dims might be enough for users. |
dcherian
commented
Dec 13, 2023
Don't you have enough already?
These ops are applied to the wrapped array not to an xarray object. |
Illviljan
commented
Dec 15, 2023
Yes, but it doesn't look insurmountable to me for Thank you for the input @dcherian. I won't merge this without approval. |
dcherian
commented
Dec 19, 2023
generally expanding |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
In pytest==9.0.0 this import error starts showing up: Reverting to pytest==8.4.2 works fine. Release summary: |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
whats-new.rstapi.rst