-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
documenting how xarray.dot() interacts with coordinates #10958
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
Conversation
|
thanks @dhruvak001 does |
|
sure, I will update. |
|
@max-sixty Updated, review whenever you get time. Thanks! |
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.
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.
|
thanks @dhruvak001 ! |
- 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>
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