Stop pycirclize from restyling the session on import - #809
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
cvanelteren
marked this pull request as ready for review
September 1, 2026 23:18
`pycirclize.config` runs `mpl.rcParams.update(...)` at import time, setting `savefig.bbox='tight'`, `savefig.pad_inches=0.5` and `svg.fonttype='none'`. UltraPlot imports it lazily, so the first chord, radar, phylogeny or circos plot in a session silently changed how every figure saved afterwards was sized and padded — a 26mm figure saved as 434px instead of 225px, with half an inch of padding nobody asked for. `_import_pycirclize` now restores those three settings after the import. Found while rendering a gallery of small figures: every thumbnail drawn after the first chord diagram came out roughly twice the canvas size.
cvanelteren
force-pushed
the
fix/pycirclize-rc-leak
branch
from
September 1, 2026 23:19
f509871 to
545aeee
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pycirclize.configrunsmpl.rcParams.update(...)at import time, settingsavefig.bbox='tight',savefig.pad_inches=0.5andsvg.fonttype='none'. UltraPlot imports it lazily, so the first chord, radar, phylogeny or circos plot in a session silently changed how every figure saved afterwards was sized and padded — a 26mm figure saved as 434px instead of 225px, with half an inch of padding nobody asked for._import_pycirclizenow restores those three settings after the import.Found while rendering a gallery of small figures: every thumbnail drawn after the first chord diagram came out roughly twice the canvas size.