Adding A Plot¶
Summary¶
The operational checklist for adding a new plot or pipeline to PyFLASH so it is
usable from Python, the spec files, and the /pyflash runner — and so the
enforcement tests stay green. The authoritative implementation contract lives in
the global pyflash-add-plot skill; this page is the wiki-side map of the
steps and the files each one touches.
Checklist¶
-
Write the function. Add
plot_<name>(...)toPyFLASH/plotting.pyfollowing the signature conventions of neighbouring plots (acceptBatch/Experiment,save=,filter_by=, and public column-selection params such asdata_cols,data_col_contains, anddata_col_exclude). Keepspecificity=only as a legacy/internal compatibility alias. Save figures throughPyFLASH.utils.save_figso SVG text stays editable. -
Register it. Add a short-name -> callable entry to
PyFLASH/spec.py::PLOT_REGISTRY. Use a bare'plot_<name>'for a plotting function, or a dotted'PyFLASH.pipeline.<name>'for a pipeline callable. See Plot Registry. -
Classify describe coverage. Add the short-name to exactly one of
DESCRIBE_COVERED,DESCRIBE_EXEMPT, orDESCRIBE_UNREVIEWEDinspec.py. If the plot computes a test/correlation/model, route those numbers through the shared engine (stats.multipleComparisons,plotting.regression_action) or callreport.emit(...)with abuild_*_recordfromPyFLASH/report.py, then mark itDESCRIBE_COVERED.tests/test_describe_coverage.pyfails until it is classified. See Structured Results. -
If it is a pipeline, add the name to
pipeline.__all__, give it amontage=Trueparameter, wear the@montage_pipeline(...)decorator, and tag headline figures withsave_fig(..., montage=True)(pull regressions on withcapture_secondary(...)). Otherwise add it topipeline.MONTAGE_EXEMPTwith a reason.tests/test_pipeline_montage.pyenforces this. -
Document it. Add a function page under
../functions/following the documentation standard, link it from api-reference, and add it to the relevant../plot-types/or../statistics/page. -
Add tests under
tests/(a smoke test that it runs and saves; a describe emit test if covered). See Testing Map. -
Reference refresh.
scripts/update_pyflash_references.pyregenerates the live-signature block in the skill reference and mirrors it to.codex; the ClaudePostToolUsehook runs it automatically after edits. You maintain the hand-written teaching prose; the generated block self-heals fromdiscover.