Skip to content

docs: correct the plot tutorials' corner.py kwarg lists and forwarding claim - #148

Merged
Jammy2211 merged 1 commit into
mainfrom
claude/autofit-plot-functions-kwargs-vvwj5x
Aug 24, 2026
Merged

docs: correct the plot tutorials' corner.py kwarg lists and forwarding claim#148
Jammy2211 merged 1 commit into
mainfrom
claude/autofit-plot-functions-kwargs-vvwj5x

Conversation

@Jammy2211

Copy link
Copy Markdown
Collaborator

Summary

Pairs with PyAutoLabs/PyAutoFit#1524 (issue PyAutoLabs/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 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_cornerpy wraps corner.py, so measured against corner's real signature those arguments were never going to apply, and today they are silently discarded:

script kwargs took effect silently discarded
emcee_plotter.py 30 30 0
dynesty_plotter.py 19 14 5 — dims, span, quantiles_2d, hist2d_kwargs, truth_kwargs (dynesty's API)
zeus_plotter.py 16 6 10 — weight_list, span, truth, alpha, linewidth, fill, fontsize, title_fontsize, cut, size (zeus's API)
nautilus_plotter.py 11 8 3 — panelsize, xticksize, yticksize

Under the library's new guard those names raise instead of vanishing, 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 is corrected to match: every script now says the kwargs go to corner.corner and that an unrecognised name raises a TypeError. Dynesty's and nautilus's _kwargs paragraphs no longer point the reader at their own sampler's plotting docs for arguments corner will receive, and zeus's link block notes that corner_cornerpy is not zeus's cornerplot.

Scripts Changed

  • scripts/plot/emcee_plotter.py — prose only; its kwarg list was already correct
  • scripts/plot/dynesty_plotter.py — 5 dynesty-only kwargs removed; _kwargs prose retargeted at corner.py
  • scripts/plot/zeus_plotter.py — kwarg list rebuilt from zeus's cornerplot arguments to corner's; link block clarified
  • scripts/plot/nautilus_plotter.py — 3 figure-geometry kwargs removed; _kwargs prose retargeted at corner.py
  • notebooks/plot/{emcee,dynesty,zeus,nautilus}_plotter.ipynb — regenerated with PyAutoHands generate.py autofit

Test Plan

  • Merge PyAutoFit#1524 first — the library-first gate. On current main these 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 figure
  • No script passes an argument that does nothing

Verified locally by parsing each script's aplt.corner_cornerpy(...) call with ast and (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 real corner_cornerpy against the pinned corner==2.2.2, which produced a figure for all four.

Note: these four scripts appear in neither smoke_tests.txt nor smoke_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

…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
@Jammy2211 Jammy2211 added the pending-release PR queued for the next release build label Aug 24, 2026 — with Claude
@Jammy2211
Jammy2211 merged commit 5056fa3 into main Aug 24, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pending-release PR queued for the next release build

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant