bloc.boulder_plugins.calc_note_export_action#
Bloc GUI plugin: export Excel Calculation Note from the web interface.
One config always expands to N >= 1 scenarios via
boulder.runset.expand_scenarios() — a plain network with no
scenarios:/sweep: block expands to a single (scenario_id, base)
tuple. Export walks that list once, regardless of N, and is purely a cache
reader: it never solves anything itself. Per scenario, a cache hit (written
by Run Simulation or Run Sweep, fingerprinted identically — see
scenario_cache) contributes its bundle; a
scenario with no cache entry is silently omitted from the workbook rather
than triggering a solve. The button itself is unavailable (greyed out)
whenever no scenario in the run-set has a cached bundle yet.
Attributes#
Classes#
Export Calculation Note from whichever scenarios are already cached. |
Functions#
Register the Calculation Note export button with Boulder's GUI action registry. |
Module Contents#
- bloc.boulder_plugins.calc_note_export_action.logger#
- bloc.boulder_plugins.calc_note_export_action.GuiActionContext = None#
- class bloc.boulder_plugins.calc_note_export_action.CalcNoteExportAction#
Bases:
boulder.gui_actions.GuiActionPluginExport Calculation Note from whichever scenarios are already cached.
A pure cache reader: never solves. Each scenario in the run-set (N = 1 for a plain network) contributes its cached bundle when one exists; a scenario with no cache entry is skipped rather than triggering a solve. The cached scenarios are then assembled into one workbook via
generate_calculation_note_stone_from_bundles().- property action_id: str#
Unique identifier for this action.
- property label: str#
Button label shown in the Simulate panel.
- property requires_simulation: bool#
When True, the action is disabled until a simulation completes.
- property estimated_seconds_per_scenario: float#
Optional per-scenario cost estimate, for a run-started ETA toast.
None (default) shows no ETA. A plugin whose cost scales with the run-set size (e.g. one cached bundle read per scenario) can return a rough per-scenario seconds figure here; the Simulate panel multiplies it by the run-set’s scenario count (from the generic sweep/scenario expansion, not anything plugin-specific) to show “~Ns expected” before running.
- is_listed(context)#
Return True when this action should appear in the Simulate panel.
- is_available(context)#
Return True when run() is allowed for context.
- run(context)#
Execute the action and return a downloadable file.
- property description: str | None#
Optional tooltip text shown next to the action’s button.
- bloc.boulder_plugins.calc_note_export_action.register_calc_note_export_action()#
Register the Calculation Note export button with Boulder’s GUI action registry.