rizer.misc.simulation.post_process_registry#
Registry of post-process quantity computations run once per simulation.
Mirrors the PLOT_KINDS/PLOT_KINDS_BY_ID registry pattern in
rizer.misc.simulation.plot_registry. Every entry is a pure function of
the raw simulation state array – never of another entry’s output – so
entries can be added, removed, or reordered freely; run_post_processors
raises loudly on any output-key collision between entries instead of letting
one silently overwrite another.
Attributes#
Classes#
One post-process computation and the metadata its outputs need. |
Functions#
|
Run every POST_PROCESSORS entry over states and merge the results. |
Module Contents#
- class rizer.misc.simulation.post_process_registry.PostProcessQuantity#
One post-process computation and the metadata its outputs need.
- Parameters:
key (
str) – Short identifier for this processor, used in collision error messages.compute (
typing.Callable) – Pure function of the raw simulation state array – never of another processor’s output – returning one or more named output columns, ascompute(states) -> dict[str, numpy.ndarray].units (
dictofstrtostr, ortyping.Callable) – Unit for every key compute returns. A dict for a processor whose output keys are known ahead of time, or a function of states (asunits(states) -> dict[str, str]) for one whose output keys depend on the mechanism’s species list.descriptions (
dictofstrtostr, ortyping.Callable) – Human-readable description for every key compute returns, in the same dict-or-callable shape as units.
- compute: collections.abc.Callable[[cantera.SolutionArray], dict[str, numpy.ndarray]]#
- units: _StaticOrPerStates#
- descriptions: _StaticOrPerStates#
- rizer.misc.simulation.post_process_registry.POST_PROCESSORS: tuple[PostProcessQuantity, Ellipsis]#
- rizer.misc.simulation.post_process_registry.run_post_processors(states: cantera.SolutionArray) tuple[dict[str, numpy.ndarray], dict[str, str], dict[str, str]]#
Run every POST_PROCESSORS entry over states and merge the results.
- Parameters:
states (
cantera.SolutionArray) – Raw simulation state array.- Returns:
- Raises:
ValueError – If two processors declare an overlapping output key.