Skip to content

Explain dimension-order alignment with a transposed array - #380

Open
Himanshuagrawal4 wants to merge 1 commit into
xarray-contrib:mainfrom
Himanshuagrawal4:PRO/xarray-dimension-order-20261105
Open

Himanshuagrawal4 wants to merge 1 commit into
xarray-contrib:mainfrom
Himanshuagrawal4:PRO/xarray-dimension-order-20261105

Conversation

@Himanshuagrawal4

Copy link
Copy Markdown

Adds a short example to the broadcasting section using arr1 and its transpose.
Their shapes differ, but subtraction aligns by dimension name and gives zeros.
An assertion makes that result explicit.

The accompanying text distinguishes alignment from the order of dimensions in
the result. It also points out when an explicit transpose is useful before
passing data to a positional array API.

Validation: all 44 cells execute on Python 3.12.16 with Xarray 2025.7.0,
within the project's declared range, and separately with Xarray 2026.9.0.
Both runs include the lesson's two unchanged raises-exception examples.
The new cells have no errors. A focused Jupyter Book build of the two changed notebooks passes with
warnings treated as errors. This is not a build of the entire upstream site.
The rendered example was inspected in a browser. Existing notebook metadata
and outputs are unchanged, and git diff --check passes.

Addresses #313.

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

This branch has not been deployed

No deployments
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.

1 participant