Postproduction architecture¶
The postproduction system is built on a YAML-driven workflow engine
(pycwb.post_production.workflow) that chains actions as a directed
acyclic graph (DAG). Actions are Python functions registered with the
action_spec() decorator
(pycwb.post_production.action_spec), declaring their inputs, outputs,
and arguments.
Key modules:
Module |
Purpose |
|---|---|
FAR vs. ranking statistic computation |
|
XGBoost classifier training |
|
Model scoring, FAR evaluation, efficiency |
|
Trigger/job selection and train/FAR splitting |
|
Trigger-to-injection matching |
|
Zero-lag significance analysis |
|
Multi-tab HTML report generation |
|
Shared Pandas ranking and projected Parquet row recovery |
For a user-facing workflow, see Post-Production Workflow Guide. Exact action interfaces are in Post-Production Action Reference and persistence rules are in Catalog format and provenance.
Action resume contracts¶
action_spec preserves the callable’s signature and adds default-on resume
for file-producing actions. Ordinary outputs declarations supply the
default essential output inventory. resume_outputs can instead be a list
of parameter names or a callable receiving resolved arguments, including
defaults, and returning file paths relative to work_dir. Include every
required product, including companions with derived filenames. Return an empty
list or use resume_outputs=False when output completeness cannot be checked.
Named parameters, declared inputs/outputs, and options listed in resume_args
form the configuration fingerprint. resume_args is needed for meaningful
options consumed through **kwargs; unrelated accumulated workflow context
is excluded. Declared inputs and named file parameters are fingerprinted by
file identity. resume_inputs overrides the declared input inventory for
structured inputs or implicit dependencies such as external job manifests;
named file parameters remain tracked. Optional missing files are recorded as
missing so their later appearance also invalidates reuse.
The completion record is JSON data, published atomically after success. Results must consist of built-in scalars, dictionaries, lists and tuples; tuple and dictionary-key types survive restoration. An unsupported return value disables reuse for the entire result, without changing normal action behavior. Before rerunning, the old record is invalidated. Changed inputs during execution also prevent recording success. Existing action arguments and returned keys remain unchanged. See Post-Production Workflow Guide for switch precedence and examples.