Skip to content

Conversation

@mjwillson
Copy link
Contributor

@mjwillson mjwillson commented Nov 22, 2025

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_join setting and making sure we have the same degree of control over this for arithmetic operations as we do for things like xr.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.

  • Tests added
  • User visible changes (including notable bug fixes) are documented in whats-new.rst

@welcome
Copy link

welcome bot commented Nov 22, 2025

Thank you for opening this pull request! It may take us a few days to respond here, so thank you for being patient.
If you have questions, some answers may be found in our contributing guidelines.

@mjwillson mjwillson force-pushed the non_index_coords_compat_override branch from 549dc59 to 6c80268 Compare December 8, 2025 13:43
@mjwillson
Copy link
Contributor Author

Thanks, have now added a DataTree test too.

@mjwillson
Copy link
Contributor Author

Quick ping on this -- anything else blocking a merge here?

@dcherian dcherian enabled auto-merge (squash) January 7, 2026 16:35
@dcherian dcherian disabled auto-merge January 7, 2026 16:35
@dcherian dcherian enabled auto-merge (squash) January 7, 2026 16:35
@max-sixty
Copy link
Collaborator

Quick ping on this -- anything else blocking a merge here?

can we fix the docs build?

@mjwillson
Copy link
Contributor Author

From a look at the doc build output I don't see anything obviously related to this PR? The doc errors are in other files (contributing.rst and docstring of xarray.computation.computation.where):
https://app.readthedocs.org/projects/xray/builds/30917736/#300840000--1723

auto-merge was automatically disabled January 9, 2026 18:00

Head branch was pushed to by a user without write access

@mjwillson mjwillson force-pushed the non_index_coords_compat_override branch from 2610402 to adb7ee2 Compare January 9, 2026 18:00
mjwillson and others added 4 commits January 9, 2026 18:01
…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.
Co-authored-by: Maximilian Roos <5635139+max-sixty@users.noreply.github.com>
@mjwillson mjwillson force-pushed the non_index_coords_compat_override branch from aefede9 to 356bdd5 Compare January 9, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants