GUIBRUSHR.core.types.chain_schema module¶
Frozen ordering contract for the flat MCMC free-parameter sequence.
ChainSchema collapses the parallel list_bestpars, list_bestpars_initial_value
and scale_vector_params lists into a single immutable object that owns
the name <-> index mapping for the chain vector newpars_chain.
The MCMC inner loop continues to operate on numpy arrays for performance;
ChainSchema is the explicit dict<->array boundary. The multi_expansion
attribute encodes how multi-valued parameters (e.g. per-night jitter)
were expanded into individual chain entries (jitter1, jitter2, …),
so create_param_full no longer needs to substring-match base names.
- class GUIBRUSHR.core.types.chain_schema.ChainSchema(names: ~typing.Tuple[str, ...], initial_values: ~numpy.ndarray, scale_vector: ~numpy.ndarray, multi_expansion: ~typing.Mapping[str, ~typing.Tuple[str, ...]] = <factory>)[source]¶
Bases:
objectImmutable description of a flat free-parameter sequence.
- Variables:
names (Tuple[str, ...]) – Ordered tuple of free-parameter names with multi-expansion already applied (e.g.
("T0", "p1", "jitter1", "jitter2", "CO", "H2O")). Aligned 1:1 withnewpars_chainand the leading axis of the stored chains arraypars[nfit, nsteps, nchains].initial_values (numpy.ndarray) –
ndarray(nfit,)of starting values, aligned withnames.scale_vector (numpy.ndarray) –
ndarray(nfit,)of DE-MCMC perturbation scales, aligned withnames. ReplacesRetrieval.scale_vector_params.multi_expansion (Mapping[str, Tuple[str, ...]]) – Mapping from a multi-valued base parameter name (e.g.
"jitter") to the ordered tuple of expanded chain names that were generated from it (e.g.("jitter1", "jitter2", "jitter3")). Empty mapping if no multi-parameters are active. Used bycreate_param_fullto attribute consecutive chain values to the right multi slot without substring matching.
- names: Tuple[str, ...]¶
- initial_values: ndarray¶
- scale_vector: ndarray¶
- multi_expansion: Mapping[str, Tuple[str, ...]]¶
- property nfit: int¶
- __init__(names: ~typing.Tuple[str, ...], initial_values: ~numpy.ndarray, scale_vector: ~numpy.ndarray, multi_expansion: ~typing.Mapping[str, ~typing.Tuple[str, ...]] = <factory>) None¶