-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Remove internal use of get/set dpi #23278
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
@scottjones03 Would you be willing to add a that exercises the issue you found with saving pdfs? If I understood what you said in #23276 correctly, making a figure with a sub-figure and then saving as a pdf to a |
Sorry, slight confused, Do you want me to summarise reproducibility steps for the bug so it can be QAd? |
Yes. I think this needs a test (probably in https://github.com/matplotlib/matplotlib/blob/main/lib/matplotlib/tests/test_figure.py) that looks something like from io import StringIO
def test_subfigure_pdf():
fig = ... # minimal code to make a broken figure
buffer = StringIO()
fig.savefig(buffer, format='pdf') so that this bug can not come back. |
I also changed the title to something I think is a bit more accurate as to what is being done here. We (for better or worse) use "deprecate" as a term of art for the process by which we remove public API from the library, where as here we are "just" not using a part of the public API internally. A deprecation will get a lot more scrutiny than an internal refactor so the adjusted title will hopefully put reviewers in the right state of mind when they click on the PR. |
Done |
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.
Might was well fix a couple things if touching these lines.
Co-authored-by: Elliott Sales de Andrade <[email protected]>
Co-authored-by: Elliott Sales de Andrade <[email protected]>
Co-authored-by: Elliott Sales de Andrade <[email protected]>
Co-authored-by: Elliott Sales de Andrade <[email protected]>
I'm not merging to give @QuLogic a chance to check (based on the review request, although I think it is OK). @scottjones03 it is possible to do "Add suggestion to batch" and then do a single commit. Not a problem since we should squash the commits before merging, but often a bit easier. |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
drat, I forgot to squash this (realized about a second after I clicked merge) 🤦🏻 |
backport is a bit gnarly. |
Merge pull request matplotlib#23278 from scottjones03/main FIX: Remove internal use of get_dpi/set_dpi (cherry picked from commit 047254d)
…-v3.5.x Backport PR #23278: Remove internal use of get/set dpi
PR Summary
There has been a mismatch between use dpi property and get/set methods internally. This has caused bugs for SubFigure objects. Please see my previous PR for more details on the issues.
PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).