bloc.io.boulder_bridge#

STONE YAML bridge — load, build, and solve networks via BlocRunner.

Combines the former stone_parser shim and simulation_builder API. All loading, normalisation, validation, mechanism resolution, and plugin registration flow through BlocRunner.

Public API#

>>> from bloc.io.boulder_bridge import build_simulation_from_yaml
>>> sim = build_simulation_from_yaml("sandbox/from_boulder/design_torch_psr_pfr.yaml")
>>> net, results = sim.solve()

Classes#

Simulation

Thin wrapper around a solved STONE YAML network.

Functions#

load_config_boulder(yaml_path)

Load and normalise a STONE config using Bloc's runner.

build_network_from_yaml(yaml_path)

Build a network and results from a STONE YAML file.

build_simulation_from_yaml(yaml_path)

Build a Simulation from STONE YAML.

Module Contents#

bloc.io.boulder_bridge.load_config_boulder(yaml_path)#

Load and normalise a STONE config using Bloc’s runner.

Returns a Boulder-normalised config dict (including Bloc-specific deprecated-key validation).

bloc.io.boulder_bridge.build_network_from_yaml(yaml_path)#

Build a network and results from a STONE YAML file.

Returns (network, results) where network is the raw visualization ReactorNet produced by build() (before solve() upgrades it to the StagedReactorNet facade).

Callers that need the typed staged network facade should use build_simulation_from_yaml() instead and access sim.network (a StagedReactorNet). If a raw ReactorNet is needed downstream, use sim.network.visualization_network.

class bloc.io.boulder_bridge.Simulation(config, results, result=None)#

Thin wrapper around a solved STONE YAML network.

Provides a minimal, stable API for downstream scripts and notebooks, and exposes a SimulationResult as result for typed access to the staged network, trajectory, per-reactor states and plugin scalars.

The central object is network, a StagedReactorNet — a ReactorNet-compatible staged network facade. It is not a single global CVODE integrator; staged solves with mechanism switches and custom PFR solvers are not one monolithic ODE problem.

Key accessor pattern:

sim.network                              # StagedReactorNet
sim.network.draw(...)                    # delegates to viz network
sim.network.get_stage("default")         # PFRHomogeneousShellNet / DesignTubeFurnaceNet
sim.network.networks                     # {stage_id: stage solver}
sim.network.visualization_network        # raw ct.ReactorNet (Sankey etc.)
config#
results#
result = None#
solve()#

Return the staged network facade and results captured during build.

property network: boulder.staged_network.StagedReactorNet#

The StagedReactorNet facade.

property reactors#

Convenience delegate to network.reactors.

property trajectory#

Convenience delegate to network.trajectory.

property scalars: Dict[str, Any]#

Convenience delegate to network.scalars.

bloc.io.boulder_bridge.build_simulation_from_yaml(yaml_path)#

Build a Simulation from STONE YAML.

All loading, normalisation, validation, mechanism resolution, and plugin registration flow through BlocRunner.

sim.network is a StagedReactorNet — a ReactorNet-compatible staged network facade that owns both the global visualization ReactorNet (sim.network.visualization_network) and the stage solver networks (sim.network.networks).

Parameters:

yaml_path – Path to a STONE-standard YAML config defining components and connections.