-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add an arithmetic_compat option to xr.set_options #10943
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
Open
mjwillson
wants to merge
4
commits into
pydata:main
Choose a base branch
from
mjwillson:non_index_coords_compat_override
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.
+136
−17
Conversation
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
|
Thank you for opening this pull request! It may take us a few days to respond here, so thank you for being patient. |
a1af177 to
4c5a3a4
Compare
…ow non-index coordinates of the same name are compared for potential conflicts when performing binary operations. The default of compat='minimal' matches the previous behaviour.
a6a29f0 to
6f90b7c
Compare
max-sixty
reviewed
Nov 28, 2025
Co-authored-by: Maximilian Roos <5635139+max-sixty@users.noreply.github.com>
dcherian
reviewed
Dec 2, 2025
dcherian
reviewed
Dec 2, 2025
| actual = alt + orig | ||
| assert_identical(expected, actual) | ||
|
|
||
| def test_math_with_arithmetic_compat_options(self) -> None: |
Contributor
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.
can we add tests for datatree also please
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This determines how non-index coordinates of the same name are compared for potential conflicts when performing binary operations.
The default is
arithmetic_compat='minimal', which matches the previous behaviour.I had originally planned to set this up to migrate the default to
arithmetic_compat='override'alongside the wider migration of default to `compat='override' elsewhere. However I've held off on this for now pending a decision on what to do anything about the original motivation of compat='minimal' here which was to drop clashing scalar coordinates that arise from things like arr[0] + arr[1].I think this is nice to have in general, complimenting the
arithmetic_joinsetting and making sure we have the same degree of control over this for arithmetic operations as we do for things likexr.merge. But the immediate motivation was#10924 where we need to skip equality checks on coordinates in situations where we want to JIT a function that uses jax arrays for coordinates.
whats-new.rst