documenting how xarray.dot() interacts with coordinates#10958
Merged
max-sixty merged 4 commits intopydata:mainfrom Dec 29, 2025
Merged
documenting how xarray.dot() interacts with coordinates#10958max-sixty merged 4 commits intopydata:mainfrom
max-sixty merged 4 commits intopydata:mainfrom
Conversation
Collaborator
|
thanks @dhruvak001 does |
Contributor
Author
|
sure, I will update. |
Contributor
Author
|
@max-sixty Updated, review whenever you get time. Thanks! |
There was a problem hiding this comment.
Pull request overview
This PR enhances the documentation for xarray.dot() and DataArray.dot() to clearly explain how these functions handle coordinate alignment, addressing issue #10899. The documentation now explicitly covers coordinate value-based alignment, inner join behavior, and how non-overlapping coordinates are handled.
- Added comprehensive "Coordinate Handling" subsection to
xarray.dot()documentation explaining alignment behavior - Enhanced
DataArray.dot()with Notes section and coordinate alignment example - Included three practical examples demonstrating value-based alignment, non-overlapping coordinates, and preserved output coordinates
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
xarray/computation/computation.py |
Added "Coordinate Handling" subsection in Notes explaining value-based alignment, inner join behavior, and mathematical equivalence; added three examples demonstrating coordinate alignment scenarios |
xarray/core/dataarray.py |
Added Notes section explaining automatic coordinate alignment with cross-reference to xarray.dot(); added example showing coordinates aligned by values rather than order |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Collaborator
|
thanks @dhruvak001 ! |
dcherian
added a commit
to dcherian/xarray
that referenced
this pull request
Jan 28, 2026
- Add missing bug fixes: pydata#11064, pydata#11026, pydata#11022, pydata#11005, pydata#10980, pydata#10788, pydata#11085 - Add missing documentation entries: pydata#10958, pydata#11094, pydata#11080 - Add missing performance entry: pydata#11105 - Add Internal Changes section with pydata#11108 - Fix rST roles: use :py:func:, :py:meth:, :py:class: consistently - Fix missing commas between :issue: and :pull: references - Fix typo in Dataset.identical entry - Fix wrong PR number for coord ordering (11098 -> 11091) - Add missing :pull: reference for arithmetic_compat (pydata#10943) Co-authored-by: Claude <noreply@anthropic.com>
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
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.
Description
This PR addresses issue #10899 by documenting how
xarray.dot()andDataArray.dot()interact with coordinates.Previously, the documentation did not explain:
Changes
Enhanced
xarray.dot()documentation (xarray/computation/computation.py)Added a new "Coordinate Handling" subsection to the Notes that clearly explains:
xr.set_options(arithmetic_join="exact")to require exact coordinate matching and raise errors on misalignmentAdded three practical examples demonstrating:
x["a", "b"] @ y["b", "a"]correctly aligns by coordinate valueEnhanced
DataArray.dot()documentation (xarray/core/dataarray.py)Added a Notes section explaining:
xarray.dot()for detailed informationAdded an example demonstrating coordinate alignment behavior.
Example Usage