docs: correct the plot tutorials' corner.py kwarg lists and forwarding claim - #148
Merged
Merged
Conversation
…g claim
Pairs with PyAutoFit#1523, which makes `autofit.plot` forward its `**kwargs`
to the library each function wraps and reject what that library cannot honour.
The four plot scripts each stated that their kwargs are "passed in ... as
described in the API docs", but three of the four had copied their list from a
*different* sampler's plotting API. `corner_cornerpy` wraps `corner.py`, so
against corner's real signature those arguments were never going to apply:
dynesty_plotter.py dims, span, quantiles_2d, hist2d_kwargs, truth_kwargs
zeus_plotter.py weight_list, span, truth, alpha, linewidth, fill,
fontsize, title_fontsize, cut, size
nautilus_plotter.py panelsize, xticksize, yticksize
Under the library's new guard these would now raise, so each list is rewritten
to genuine `corner.py` arguments. `emcee_plotter.py`'s 30 kwargs were already
all corner's and are unchanged. The prose in every script now says the kwargs
go to `corner.corner` and that an unrecognised name raises, and dynesty's and
nautilus's `_kwargs` paragraphs no longer point the reader at their own
sampler's plotting docs for arguments corner will receive.
Verified by rendering each script's exact kwarg list through the real
`corner_cornerpy` against corner 2.2.2 — all four produce a figure.
Notebooks regenerated with PyAutoHands `generate.py autofit`.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G8EXazf2FEqf4S9UpTwMGV
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.
Summary
Pairs with PyAutoLabs/PyAutoFit#1524 (issue PyAutoLabs/PyAutoFit#1523), which makes
autofit.plotforward its**kwargsto the library each function wraps and reject what that library cannot honour.The four plot scripts each told the reader their kwargs are "passed in ... as described in the API docs" — but three of the four had copied their list from a different sampler's plotting API.
corner_cornerpywrapscorner.py, so measured against corner's real signature those arguments were never going to apply, and today they are silently discarded:emcee_plotter.pydynesty_plotter.pydims,span,quantiles_2d,hist2d_kwargs,truth_kwargs(dynesty's API)zeus_plotter.pyweight_list,span,truth,alpha,linewidth,fill,fontsize,title_fontsize,cut,size(zeus's API)nautilus_plotter.pypanelsize,xticksize,yticksizeUnder the library's new guard those names raise instead of vanishing, so each list is rewritten to genuine
corner.pyarguments.emcee_plotter.py's 30 kwargs were already all corner's and are unchanged.The prose is corrected to match: every script now says the kwargs go to
corner.cornerand that an unrecognised name raises aTypeError. Dynesty's and nautilus's_kwargsparagraphs no longer point the reader at their own sampler's plotting docs for arguments corner will receive, and zeus's link block notes thatcorner_cornerpyis not zeus'scornerplot.Scripts Changed
scripts/plot/emcee_plotter.py— prose only; its kwarg list was already correctscripts/plot/dynesty_plotter.py— 5 dynesty-only kwargs removed;_kwargsprose retargeted atcorner.pyscripts/plot/zeus_plotter.py— kwarg list rebuilt from zeus'scornerplotarguments to corner's; link block clarifiedscripts/plot/nautilus_plotter.py— 3 figure-geometry kwargs removed;_kwargsprose retargeted atcorner.pynotebooks/plot/{emcee,dynesty,zeus,nautilus}_plotter.ipynb— regenerated with PyAutoHandsgenerate.py autofitTest Plan
mainthese scripts still work (the kwargs are ignored); against the library PR, the removed names would raise.python scripts/plot/emcee_plotter.py(and the dynesty / zeus / nautilus siblings) run to completion and produce a corner figureVerified locally by parsing each script's
aplt.corner_cornerpy(...)call withastand (a) checking every name against the library guard's accepted set — all four clean — and (b) rendering each script's exact kwarg list through the realcorner_cornerpyagainst the pinnedcorner==2.2.2, which produced a figure for all four.Note: these four scripts appear in neither
smoke_tests.txtnorsmoke_notebooks.txt, so workspace CI does not execute them — the checks above are the coverage.Generated by the PyAutoLabs agent workflow.
Generated by Claude Code