-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add expand_dims #8407
Add expand_dims #8407
Conversation
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
…into add_expand_dims
for more information, see https://pre-commit.ci
…into add_expand_dims
for more information, see https://pre-commit.ci
…into add_expand_dims
for more information, see https://pre-commit.ci
Thanks @Illviljan we've been leaning toward not providing Array API specifically because there's quite some potential for confusing mismatches like this one. |
What mismatch? This is only expanding on the standard which in my view should be fine. How do you plan on handling expanding dims ( We have to handle The current _array_api is not public yet either, at this point it's just solving issues that we aren't yet testing for since we barely test any arrayapi compliant arrays at the moment. |
after reading data-apis/array-api#698 (comment), i support the idea of implementing the same (or expanded) syntax and semantics as the array API standard for a subset of the array API spec when possible. it appears that as long as we don't add a to proceed in the right direction, i'm curious to hear what your take is, @dcherian / @Illviljan |
@Illviljan, since we do not plan on declaring |
Considering how much xarray has pushed upstream array-libraries to follow various standards, ufunc/array_function/array_api, I think it's bad form to not make an effort to respect the standards ourselves. Whether we start supporting it officially in the future or not. I wouldn't mind adding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you, @Illviljan
This allows adding a dimension of an array. Which is relevant when for example using
keepdims
in NamedArray.reduce.Normally you can do this with
None
but that's not really allowed in the getitem documentation currently https://data-apis.org/array-api/2022.12/API_specification/generated/array_api.array.__getitem__.htmlShould follow the standard but with an additional
dim
argument,dim
should be preferred over theaxis
argument.https://data-apis.org/array-api/draft/API_specification/generated/array_api.expand_dims.html
xref #8344, #8406