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#
Return display-only Cytoscape elements for parameter-backed energy streams. |
|
|
Register |
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 viabloc.reactors.energy_stream.is_energy_port_kind()– not hardcoded to torch, so any future parameter-backed stream is picked up automatically) withelectric_power_kW > 0, emits one “Electricity” source node and one dottedEnergyStreamedge into it. Wall-backed streams (e.g. the PFR’s ambient loss) are naturally excluded: those reactors have noelectric_power_kWproperty, 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-inconfigdict, and never touches the STONEnodes:/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_synthesizersmay not exist yet on the installed Boulder version’sBoulderPluginsdataclass (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 untilconfig_to_cyto_elementsis updated to call it.