bloc.boulder_plugins.energy_stream_display#

Cytoscape display synthesis for Bloc’s Energy Stream concept.

Torch electrical power (see bloc.reactors.energy_stream) is a pure Bloc-side bookkeeping construct – it never becomes a STONE node/connection that Boulder’s Cantera build phase resolves (there is no meaningful gas composition for an “Electricity” source, and the power is applied as a one-shot enthalpy jump, never through a live Wall). To still show it in the interactive graph, this module synthesizes a display-only node + edge purely for boulder.utils.config_to_cyto_elements()’s output – the same way that function already synthesizes stream-point diamond nodes for inter-stage display without mutating the stored config.

Registered onto plugins.cyto_element_synthesizers (a Boulder-side plugin hook; see the BoulderPlugins dataclass) so Boulder’s core stays unaware of “Energy Stream” as a concept – it just calls whatever synthesizers are registered and appends their output.

Functions#

synthesize_energy_stream_elements(config)

Return display-only Cytoscape elements for parameter-backed energy streams.

register_energy_stream_display(plugins)

Register synthesize_energy_stream_elements() onto plugins.

Module Contents#

bloc.boulder_plugins.energy_stream_display.synthesize_energy_stream_elements(config)#

Return display-only Cytoscape elements for parameter-backed energy streams.

For every node whose reactor class uses EnergyPortMixin (detected via bloc.reactors.energy_stream.is_energy_port_kind() – not hardcoded to torch, so any future parameter-backed stream is picked up automatically) with electric_power_kW > 0, emits one “Electricity” source node and one dotted EnergyStream edge into it. Wall-backed streams (e.g. the PFR’s ambient loss) are naturally excluded: those reactors have no electric_power_kW property, so the gate below skips them – they already have a real STONE Wall connection for Boulder to draw. Never reads or mutates anything beyond the passed-in config dict, and never touches the STONE nodes:/connections: lists Boulder’s Cantera build phase consumes – this only runs against the config as seen by the graph display layer.

bloc.boulder_plugins.energy_stream_display.register_energy_stream_display(plugins)#

Register synthesize_energy_stream_elements() onto plugins.

Defensive: cyto_element_synthesizers may not exist yet on the installed Boulder version’s BoulderPlugins dataclass (it is a new hook this feature introduces there). Creating it here is harmless even before that Boulder-side change lands – it is simply an unread attribute until config_to_cyto_elements is updated to call it.