GUIBRUSHR.core.types.param_registry module¶
Name-keyed wrapper for the canonical parameter array.
ParamRegistry is a thin container that exposes the same ordered sequence
as the legacy initial_param_array list, but indexed primarily by parameter
name. It also provides named-anchor slice helpers so that callers like
LikelihoodHR and SpeciesMolec can request “all molecule slots” or
“all condensed-species slots” without carrying integer section starts.
Backed internally by an ordered dict so that ordering matches
ConstantVariables.params_list exactly.
- class GUIBRUSHR.core.types.param_registry.ParamRegistry(params_list: Sequence[str])[source]¶
Bases:
objectOrdered, name-keyed registry of parameter slots.
The registry has one slot per name in
params_list; each slot may hold aParamForModelinstance or remainNonefor parameters that are not active in the current retrieval.- property names: tuple[str, ...]¶
- as_list() List[object][source]¶
Return slot values as a plain list in canonical order.
Bridge for consumers that still expect initial_param_array to behave like a list (Phase 1/2 compatibility).
- slice_by_name(start: str, end: str | None = None) List[object][source]¶
Return slot values from
start(inclusive) toend(exclusive).endmay beNoneto slice to the end of the registry.
- populate_from_list(source: Iterable) None[source]¶
Replace slot values in canonical order from an iterable.
Accepts an iterable of length equal to
len(self); each value is assigned to the slot at the corresponding position. This is used by Phase-1 wiring to derive a registry from the legacyinitial_param_arraylist without touching the build logic.
- GUIBRUSHR.core.types.param_registry.slice_section(container, params_list: Sequence[str], start_name: str, end_name: str | None = None) List[object][source]¶
Return slot values from
start_name(incl) toend_name(excl).Works on both a legacy
list(positional, indexed byparams_list) and aParamRegistry. Whenend_nameisNonethe slice runs to the end of the container.For list inputs, the container length must equal
len(params_list); a mismatch would silently truncate or over-read the slice with no user-visible error. The assertion makes the contract loud.