boulder.summary_builder#
Summary Builder System for Boulder.
This module provides the base classes and infrastructure for creating custom summary builders that can process simulation results and generate summary data for display in Boulder’s output panes.
Classes#
Context information passed to summary builders. |
|
Base class for Summary builders. |
|
Default summary builder that extracts basic reactor properties. |
|
Registry for Summary Builder plugins. |
Functions#
Get the global summary builder registry. |
|
|
Register a summary builder with the global registry. |
|
Build summary data from a simulation using the specified or default builder. |
Module Contents#
- class boulder.summary_builder.SummaryContext#
Context information passed to summary builders.
- simulation: cantera.ReactorNet | None = None#
- config: Dict[str, Any] | None = None#
- simulation_data: Dict[str, Any] | None = None#
- output_config: Dict[str, Any] | None = None#
- stage_networks: Dict[str, Any]#
- class boulder.summary_builder.SummaryBuilder#
Bases:
abc.ABCBase class for Summary builders.
Summary builders process simulation results and generate summary data that can be displayed in Boulder’s Summary output pane.
- property builder_id: str#
- Abstractmethod:
Unique identifier for this summary builder.
- property name: str#
- Abstractmethod:
Human-readable name for this summary builder.
- is_compatible(context)#
Check if this builder is compatible with the given simulation context.
- Args:
context: Current context information
- Return type:
True if the builder can process this simulation,False otherwise
- abstractmethod build_summary(context)#
Build summary data from the simulation context.
- Args:
context: Current context information
- Returns:
Listofsummary entries,each containing- reactor (
reactor name (optional))- quantity (
quantity name)- label (
display label)- value (
numeric valueorstring)- unit (
unit string (optional))
- class boulder.summary_builder.DefaultSummaryBuilder#
Bases:
SummaryBuilderDefault summary builder that extracts basic reactor properties.
- property builder_id: str#
Unique identifier for this summary builder.
- property name: str#
Human-readable name for this summary builder.
- build_summary(context)#
Build default summary from reactor states.
- is_compatible(context)#
Check if this builder is compatible with the given simulation context.
- Args:
context: Current context information
- Return type:
True if the builder can process this simulation,False otherwise
- class boulder.summary_builder.SummaryBuilderRegistry#
Registry for Summary Builder plugins.
- builders: Dict[str, SummaryBuilder]#
- register(builder)#
Register a new summary builder.
Re-registering the same builder ID is a no-op so that plugins discovered via both entry points and
BOULDER_PLUGINSdo not raise on the second call.
- get_builder(builder_id)#
Get a builder by its ID.
- get_compatible_builders(context)#
Get list of builders compatible with the given context, most specific first.
The default builder answers for every simulation, and it registers before any plugin can, so ordering by registration alone would always pick it and no registered plugin builder would ever run. It is therefore ordered last: a builder that declares itself compatible is the more specific answer, and the caller takes the first one.
- boulder.summary_builder.get_summary_builder_registry()#
Get the global summary builder registry.
- boulder.summary_builder.register_summary_builder(builder)#
Register a summary builder with the global registry.
- boulder.summary_builder.build_summary_from_simulation(simulation, config=None, simulation_data=None, builder_id=None, stage_networks=None)#
Build summary data from a simulation using the specified or default builder.
- Args:
simulation: Cantera ReactorNet simulation config: Configuration dictionary simulation_data: Additional simulation data builder_id: ID of specific builder to use, or None for default stage_networks: Per-stage solver networks of a staged solve, keyed by
stage id; see
SummaryContext.stage_networks
- Return type:
Listofsummary entries