Skip to content

Check that stem input is 1D #30233

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
Jul 6, 2025
Merged

Check that stem input is 1D #30233

merged 1 commit into from
Jul 6, 2025

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Jul 1, 2025

PR summary

This also has the side-effect of casting torch Tensors to NumPy arrays, which fixes #30216. Since stem is made up of plot and [hv]lines whic already do this cast, this just moves it up one level which prevents doing it twice.

We don't have any testing with torch directly, so I didn't add any of that sort.

PR checklist

Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've not analyzed the details, but is _check_1d compatible with unit hanling? hlines/vlines do _proces_unit_info as their first task.

@QuLogic
Copy link
Member Author

QuLogic commented Jul 4, 2025

I did insert this after stem does its own _process_unit_info calls. At least there's a datetime test for stem in test_datetime that didn't seem to break.

This also has the side-effect of casting torch Tensors to NumPy arrays,
which fixes matplotlib#30216. Since `stem` is made up of `plot` and `[hv]lines`
whic already do this cast, this just moves it up one level which
prevents doing it twice.
@dstansby dstansby added this to the v3.10.4 milestone Jul 6, 2025
@dstansby dstansby merged commit 947590d into matplotlib:main Jul 6, 2025
40 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jul 6, 2025
dstansby added a commit that referenced this pull request Jul 6, 2025
…233-on-v3.10.x

Backport PR #30233 on branch v3.10.x (Check that stem input is 1D)
@QuLogic QuLogic deleted the stem-1d branch July 6, 2025 22:58
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.

[Bug]: stem complaining about PyTorch's Tensor
3 participants