bloc.boulder_plugins.calc_note_cache_contributor#
Bloc cache contributor for the Calculation Note.
When Boulder completes a GUI simulation, this contributor runs immediately
after the solve (while live Cantera objects are still in memory) to produce
a cached scenario bundle + figure PNGs. On the next Export Calculation
Note click the export action reads the bundle from the cache instead of
re-running the simulation.
The contributor is registered via register_cache_contributor() from
boulder.result_cache so that Boulder’s plugin machinery snapshots it
into cache_contributors
and the worker calls it on the solver path.
Attributes#
Classes#
Boulder |
Functions#
Register |
Module Contents#
- bloc.boulder_plugins.calc_note_cache_contributor.logger#
- bloc.boulder_plugins.calc_note_cache_contributor.write_bundle = None#
- class bloc.boulder_plugins.calc_note_cache_contributor.CalcNoteCacheContributor#
Bases:
boulder.result_cache.CacheContributorPluginBoulder
CacheContributorPluginfor Bloc.Runs
collect_scenario_bundle()on the solved simulation immediately after the GUI solve, then persists the result to the cache entry’sartifacts/directory usingwrite_bundle().Only runs when the config has an
export:block, which signals that a Calculation Note is expected for this YAML.- property contributor_id: str#
Unique id consumed by Boulder’s contributor registry.
- contribute(config, converter, simulation_result, fingerprint, artifacts_dir)#
Collect and persist the base-scenario Calculation Note bundle.
- Parameters:
config – Post-solve, fully normalised config (post stream-point enrichment).
converter – The solved
DualCanteraConverterinstance so thatpoints_from_streamshas access to live objects.simulation_result –
SimulationResultbuilt from the converter by the worker.fingerprint – Cache entry fingerprint hex.
artifacts_dir – Directory where the bundle JSON and figure PNGs are written.
- bloc.boulder_plugins.calc_note_cache_contributor.register_calc_note_cache_contributor()#
Register
CalcNoteCacheContributorwith Boulder’s cache registry.Safe to call multiple times — duplicate registration is a no-op.