Scenario Planner API
The scenario planner API lives under abacus.scenario_planner.
Use it when you want to compare current, manual, and fixed-budget optimised plans in total horizon spend units.
For workflow guidance, see Scenario Planning.
Main import path
The package also exports shared base types:
BaseScenarioSpecHistoricalReferenceScenarioSpecSimulatedScenarioSpecScenarioSpec
Scenario spec classes
Main concrete spec types:
| Type | Purpose |
|---|---|
CurrentScenarioSpec |
Historical reference scenario |
ManualAllocationScenarioSpec |
User-defined future allocation |
FixedBudgetOptimizedScenarioSpec |
Fixed-budget optimised future allocation |
DataArraySpec |
JSON-friendly or YAML-friendly xarray representation |
Shared fields across the concrete specs include:
namestart_dateend_datescenario_id
Planner service objects
Main service types:
| Type | Purpose |
|---|---|
ScenarioPlanner |
Evaluate and compare scenarios for a fitted PanelMMM |
ScenarioResult |
Output object from evaluate(...) |
ScenarioComparison |
Combined output object from compare(...) |
ScenarioPlanner
Main methods:
| Method | Purpose |
|---|---|
evaluate(spec) |
Evaluate one scenario and return ScenarioResult |
compare(specs) |
Evaluate several scenarios and return ScenarioComparison |
Useful property:
| Property | Meaning |
|---|---|
channels |
Modelled channel names |
ScenarioResult
ScenarioResult exposes:
spectotalschannelscontributions_over_timeallocationmetadata
ScenarioComparison
ScenarioComparison exposes:
totalschannelscontributions_over_timeallocationsmetadata
It also provides:
to_store_payload() returns a JSON-friendly payload for client-side UIs.
Dash app entry point
The optional UI lives in a separate module:
Use it like this:
The Dash app visualises a precomputed ScenarioComparison. It does not run
the planner itself.