Free-parameter records (pybnf.parameter_record)¶
The new-era parameter: record -> FreeParameter (ADR-0043).
The edition-2 free-parameter declaration is a fully labeled record –
parameter: <id>, prior: <family>, <field>: <v>, ..., lower: <lo>, upper: <hi>,
initial_value: <v> – where the legacy positional <family>_var = <id> p1 p2 line
names nothing. It is also the only grammar that carries lower/upper, so a
truncated prior (two-sided, ADR-0020; half-bounded, ADR-0047) can be written no other way.
This module is the one mapping from that record onto a FreeParameter, with two
consumers. pybnf.config.Configuration reads it when it loads a job to fit, and
pybnf.petab.export reads it when it serializes a job to a PEtab v2 problem. They
must agree: a PEtab row and a native declaration landing on the same object is the
two-adapter proof (ADR-0004), and an exporter that re-derived the record grammar for
itself would drift from the one the fitter actually runs. It lived as a private
Configuration method until the exporter needed it, and was silently skipping every
parameter: record for want of it (#733).
Light by design (printing / priors / pset / numpy): the exporter reads a job
through the stdlib ploop parser without building a Configuration, and pulling the
whole configuration layer in to reach one builder would defeat that.
- pybnf.parameter_record.free_parameter_from_record(pid, raw_fields, initialization_distribution)[source]¶
Build a
FreeParameterfrom a new-eraparameter:record (ADR-0043).raw_fieldsis the parsed{field: str}map – every part of the line is named:prior(the family),space(linear/log10, the sampling-space transform), the family’s own distribution fields (mean/sd,location/scale, …),lower/upper(the bounds that truncate the prior – #417/ADR-0020), andinitial_value(the start point). No positional numbers; the family names its fields viaPrior.field_names. The truncation/box capability is unchanged – this only maps named fields onto the existingFreeParameterconstructor.