What
The TOU derivation script (utils/pre/compute_tou.py) currently computes demand-weighted average MCs per season, then rescales them so the load-weighted mean equals a base_rate from a calibrated flat tariff (from runs 1 and 2). This discards the MC absolute level and anchors to a reference tariff, creating unnecessary upstream dependencies:
run-9 → needs run-1 to get nyseg_flat_calibrated.json as the base rate anchor
run-10 → needs run-2 to get nyseg_flat_supply_calibrated.json as the base rate anchor
Why
Since CAIRO's precalc recalibrates the absolute level anyway, rescaling to a reference tariff base rate is unnecessary. Eliminating this dependency lets TOU tariffs be generated entirely in all-pre, decouples runs 9 and 10 from runs 1 and 2, and makes the rate derivation more semantically correct (rates reflect actual MC; precalc calibrates revenue neutrality).
How
utils/pre/compute_tou.py — Remove base_rate parameter from compute_seasonal_base_rates; return raw demand-weighted average MCs directly (no rescaling).
utils/pre/derive_seasonal_tou.py — Remove tou_base_rate parameter from derive_seasonal_tou(); update the call to compute_seasonal_base_rates; remove --tou-base-rate CLI arg; keep --reference-tariff but use it only for fixedchargefirstmeter (not base rate); remove the tou_base_rate is None validation guard.
rate_design/hp_rates/Justfile — Add create-tou-tariffs recipe that runs after create-flat-tariffs and update all-pre accordingly; simplify run-9 and run-10 to just call run-scenario.
utils/Justfile — Update create-seasonal-tou recipe description to reflect the new role of --reference-tariff.
tests/test_derive_seasonal_tou.py — Remove tou_base_rate=0.1 from derive_seasonal_tou() call.
context/code/marginal_costs/compute_tou_from_marginal_costs.md — Update to reflect that rates are output directly from MC without rescaling.
Deliverables
- PR merging the changes above
- Runs 9 and 10 pass without relying on run-1/run-2 outputs
just check and just test pass
What
The TOU derivation script (
utils/pre/compute_tou.py) currently computes demand-weighted average MCs per season, then rescales them so the load-weighted mean equals abase_ratefrom a calibrated flat tariff (from runs 1 and 2). This discards the MC absolute level and anchors to a reference tariff, creating unnecessary upstream dependencies:run-9→ needsrun-1to getnyseg_flat_calibrated.jsonas the base rate anchorrun-10→ needsrun-2to getnyseg_flat_supply_calibrated.jsonas the base rate anchorWhy
Since CAIRO's precalc recalibrates the absolute level anyway, rescaling to a reference tariff base rate is unnecessary. Eliminating this dependency lets TOU tariffs be generated entirely in
all-pre, decouples runs 9 and 10 from runs 1 and 2, and makes the rate derivation more semantically correct (rates reflect actual MC; precalc calibrates revenue neutrality).How
utils/pre/compute_tou.py— Removebase_rateparameter fromcompute_seasonal_base_rates; return raw demand-weighted average MCs directly (no rescaling).utils/pre/derive_seasonal_tou.py— Removetou_base_rateparameter fromderive_seasonal_tou(); update the call tocompute_seasonal_base_rates; remove--tou-base-rateCLI arg; keep--reference-tariffbut use it only forfixedchargefirstmeter(not base rate); remove thetou_base_rate is Nonevalidation guard.rate_design/hp_rates/Justfile— Addcreate-tou-tariffsrecipe that runs aftercreate-flat-tariffsand updateall-preaccordingly; simplifyrun-9andrun-10to just callrun-scenario.utils/Justfile— Updatecreate-seasonal-tourecipe description to reflect the new role of--reference-tariff.tests/test_derive_seasonal_tou.py— Removetou_base_rate=0.1fromderive_seasonal_tou()call.context/code/marginal_costs/compute_tou_from_marginal_costs.md— Update to reflect that rates are output directly from MC without rescaling.Deliverables
just checkandjust testpass