Skip to content

Change .T to .transpose() in _reshape_2D #29896

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

Merged
merged 1 commit into from
Apr 10, 2025

Conversation

mtsokol
Copy link
Contributor

@mtsokol mtsokol commented Apr 10, 2025

Hi!

This PR introduces a small change to lib/matplotlib/cbook.py. To make .T Array API compatible it must raise an exception for scalar arrays and arrays with ndim != 2.
In numpy/numpy#28678 we first introduce a warning for that purpose.

matplotlib that is used in NumPy docs-check CI job causes a failure by raising multiple warnings from plt.hist. This backward-compatible change fixes it. .transpose() stays the same as it isn't covered in Array API.

@story645 story645 merged commit 26d482b into matplotlib:main Apr 10, 2025
40 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Apr 10, 2025
timhoffm added a commit that referenced this pull request Apr 10, 2025
…896-on-v3.10.x

Backport PR #29896 on branch v3.10.x (Change `.T` to `.transpose()` in `_reshape_2D`)
@mtsokol mtsokol deleted the cbook-_reshape_2D-tweak branch April 11, 2025 08:40
@ksunden ksunden mentioned this pull request May 9, 2025
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants