Skip to content

Allow Python native sequences in Matplotlib imsave(). #29931

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 17, 2025

Conversation

guillermodotn
Copy link
Contributor

PR summary

This PR addresses issue #29183 by casting Python sequence types (e.g., lists or tuples) to NumPy arrays during the image saving process.

The implementation is inspired by PR #29203 by @gpxxlt, which currently appears to be on hold.

PR checklist

Co-authored-by: Yuepeng Gu <yuepengg@andrew.cmu.edu>
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join us on gitter for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide

We strive to be a welcoming and open project. Please follow our Code of Conduct.

@tacaswell tacaswell added this to the v3.10.2 milestone Apr 17, 2025
@ksunden ksunden merged commit 6d98336 into matplotlib:main Apr 17, 2025
40 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Apr 17, 2025
@QuLogic
Copy link
Member

QuLogic commented Apr 18, 2025

Why did ruff not catch the style errors here (which the backport did since it's still using flake8)?

@guillermodotn
Copy link
Contributor Author

Why did ruff not catch the style errors here (which the backport did since it's still using flake8)?

It seems the rule E302 is not enforced in pyproject.toml, as seen here.

According to the Ruff documentation, this rule is currently marked as unstable, so Matplotlib doesn’t appear to make use of it at the moment.

@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.

4 participants