Skip to content

Stop pycirclize from restyling the session on import - #809

Merged
cvanelteren merged 1 commit into
mainfrom
fix/pycirclize-rc-leak
Sep 1, 2026
Merged

Stop pycirclize from restyling the session on import#809
cvanelteren merged 1 commit into
mainfrom
fix/pycirclize-rc-leak

Conversation

@cvanelteren

Copy link
Copy Markdown
Collaborator

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.

@codecov

codecov Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cvanelteren
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
cvanelteren force-pushed the fix/pycirclize-rc-leak branch from f509871 to 545aeee Compare September 1, 2026 23:19
@cvanelteren
cvanelteren merged commit c492649 into main Sep 1, 2026
18 checks passed
@cvanelteren
cvanelteren deleted the fix/pycirclize-rc-leak branch September 1, 2026 23:30
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.

1 participant