Skip to content

Commit d4a8d8a

Browse files
authored
Merge pull request #463 from switchbox-data/388-cairo-demand-flex-shift-stability-fix
Fix CAIRO demand-flex hour-share blow-up on near-zero/negative TOU periods
2 parents cda7561 + 940c1a3 commit d4a8d8a

8 files changed

Lines changed: 539 additions & 30 deletions

File tree

context/README.md

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ Documents that answer **"How does this work in the real world?"** — policy exp
1212

1313
Fairness, cost allocation, and how regulators use ECOS vs MCOS. Feeds BAT/marginal-cost/residual methodology.
1414

15-
| File | Purpose |
16-
| ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
17-
| fairness_in_cost_allocation.md | Step-by-step philosophical guide to fairness in cost allocation: beneficiary-pays principle, why cost-causation works for energy and new capacity but fails for sunk costs, benefit-proportional sunk cost allocation, practical options, and how the BAT framework measures departures from these principles |
18-
| ny_psc_how_ecos_and_mcos_are_used.md | How NY allocates electric utility costs between customer classes: ECOS for inter-class revenue allocation (NARUC three-step), MCOS for rate design and DER compensation (VDER, marginal-cost floors, TOU guidance). Dual-study framework. |
19-
| residual_allocation_in_solar_cross_subsidy_studies.md | Allocation mechanics in solar cross-subsidy studies: ECOS vs marginal-cost-plus-residual, NARUC three-step, demand allocators (CP, NCP, AED), residual treatment; how allocator choice affects measured cross-subsidy. |
15+
| File | Purpose |
16+
| ----------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
17+
| fairness_in_cost_allocation.md | Step-by-step philosophical guide to fairness in cost allocation: beneficiary-pays principle, why cost-causation works for energy and new capacity but fails for sunk costs, benefit-proportional sunk cost allocation, practical options, and how the BAT framework measures departures from these principles |
18+
| ny_psc_how_ecos_and_mcos_are_used.md | How NY allocates electric utility costs between customer classes: ECOS for inter-class revenue allocation (NARUC three-step), MCOS for rate design and DER compensation (VDER, marginal-cost floors, TOU guidance). Dual-study framework. |
19+
| residual_allocation_in_solar_cross_subsidy_studies.md | Allocation mechanics in solar cross-subsidy studies: ECOS vs marginal-cost-plus-residual, NARUC three-step, demand allocators (CP, NCP, AED), residual treatment; how allocator choice affects measured cross-subsidy. |
20+
| supply_vs_delivery_cost_allocation.md | How cost allocation differs for supply (generation) vs delivery (T+D): supply costs are observable and traceable to load (flat → load-weighted → TOU → RTP progression with worked examples), delivery costs are committed historically and attributed by proxy (ECOS); why the BAT matters most on the delivery side. |
2021

2122
### domain/charges/
2223

@@ -101,19 +102,21 @@ Run ordering, Justfile dependency chain, and multi-step workflows.
101102

102103
How CAIRO works: LMI, demand flex, tax rate, tiered rates, performance, parallelism.
103104

104-
| File | Purpose |
105-
| ----------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
106-
| cairo_lmi_and_bat_analysis.md | CAIRO LMI parameters, discount mechanisms, and how the Bill Alignment Test (BAT) works |
107-
| cairo_demand_flexibility_workflow.md | CAIRO demand-flexibility workflow, two-pass RR recalibration, and data flow |
108-
| demand_flex_residual_treatment.md | Frozen vs. fixed-RR residual treatment in demand flex: two approaches, economic interpretations, temporal assumptions, and when to use each |
109-
| cairo_utility_tax_rate.md | CAIRO `utility_tax_rate` parameter: how to apply percentage-of-bill charges (taxes, assessments, settlement surcharges) in both bill calcs and BAT; wiring through run_scenario, single-rate limitation, PSEG-LI NYSA/Shoreham example |
110-
| cairo_tiered_rates_support.md | CAIRO tiered rate support: precalc and bill calc use (period, tier); evidence from codebase |
111-
| cairo_performance_analysis.md | CAIRO execution profile, compute bottlenecks, parallelism status, and speedup opportunities |
112-
| cairo_parallelize_two_undasked_stages.md | Handoff: parallelize process_residential_hourly_demand and BAT in CAIRO via chunk + dask.delayed |
113-
| cairo_parallelism_and_workers.md | How to think about parallelism: infra instance, worker count, series vs parallel tracks |
114-
| cairo_elastic_cluster.md | Elastic Dask cluster: why (many runs), options (dask-cloudprovider etc.), CAIRO + platform changes |
115-
| cairo_speedup_summary.md / cairo_speedup_log.md | Speedup notes and log |
116-
| er_bat_increase_under_hp_seasonal_rate.md | Why electric resistance BAT increases under the HP seasonal rate: subclass RR split mechanics, non-HP flat rate rise, ER as collateral damage of HP-only fix |
105+
| File | Purpose |
106+
| -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
107+
| cairo_lmi_and_bat_analysis.md | CAIRO LMI parameters, discount mechanisms, and how the Bill Alignment Test (BAT) works |
108+
| cairo_demand_flexibility_workflow.md | CAIRO demand-flexibility workflow, two-pass RR recalibration, and data flow |
109+
| demand_flex_residual_treatment.md | Frozen vs. fixed-RR residual treatment in demand flex: two approaches, economic interpretations, temporal assumptions, and when to use each |
110+
| demand_flex_seasonal_elasticity_derivation_path.md | Seasonal elasticity + TOU derivation JSON (`find_tou_derivation_path`), YAML vs runtime tariff stems, the supply-derivation gap, and the hour-share / `FLEX_SHIFT_MIN_PERIOD_ABS_KWH` safe-division behavior |
111+
| nimo_flex_demand_charge_regression.md | NiMo demand-flex incident writeup: elasticity wiring, TOU derivation alignment, the PV/near-zero `q_orig` division bug, the `utils/cairo.py` fix + tests, and `ur_dc_enable` notes |
112+
| cairo_utility_tax_rate.md | CAIRO `utility_tax_rate` parameter: how to apply percentage-of-bill charges (taxes, assessments, settlement surcharges) in both bill calcs and BAT; wiring through run_scenario, single-rate limitation, PSEG-LI NYSA/Shoreham example |
113+
| cairo_tiered_rates_support.md | CAIRO tiered rate support: precalc and bill calc use (period, tier); evidence from codebase |
114+
| cairo_performance_analysis.md | CAIRO execution profile, compute bottlenecks, parallelism status, and speedup opportunities |
115+
| cairo_parallelize_two_undasked_stages.md | Handoff: parallelize process_residential_hourly_demand and BAT in CAIRO via chunk + dask.delayed |
116+
| cairo_parallelism_and_workers.md | How to think about parallelism: infra instance, worker count, series vs parallel tracks |
117+
| cairo_elastic_cluster.md | Elastic Dask cluster: why (many runs), options (dask-cloudprovider etc.), CAIRO + platform changes |
118+
| cairo_speedup_summary.md / cairo_speedup_log.md | Speedup notes and log |
119+
| er_bat_increase_under_hp_seasonal_rate.md | Why electric resistance BAT increases under the HP seasonal rate: subclass RR split mechanics, non-HP flat rate rise, ER as collateral damage of HP-only fix |
117120

118121
### code/data/
119122

0 commit comments

Comments
 (0)