Add fair-default rate design pipeline for NY#418
Open
sherryzuo wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR delivers the full fair-default rate design pipeline for NY — the modules, configs, tariff artifacts, tests, and orchestration scaffolding needed to run the three closed-form fair-default strategies (A:
fixed_charge_only, B:seasonal_rates_only, C:fixed_plus_seasonal_mc) across all six NY utilities.Key deliverables:
utils/mid/compute_fair_default_inputs.py— computes class and HP subclass aggregate inputs (kWh by season, bills, cross-subsidy) from CAIRO baseline outputsutils/mid/create_fair_default_tariff.py— closed-form solver for strategies A/B/C via Cramer's rule; returns a modified URDB tariff JSONutils/mid/prepare_fair_default_tariffs.py— orchestration layer that runs strategies across all utilities in a batchutils/pre/create_fair_default_scenario_yamls.py— generates per-utility fair-default scenario YAMLs (runs 101–124)utils/pre/compute_tou.py— demand-weighted rho_MC input for strategy Cvalidate_config.pyto requirebulk_txentry in marginal-cost configscontext/methods/tou_and_rates/fair_default_rate_design.md— full math derivation, closed-form strategies, feasibility geometrytest_compute_fair_default_inputs.py,test_create_fair_default_tariff.py,test_compute_fair_default_feasible_line.py,test_compute_tou.py.gitignore: added.tmp/for local pytest basetemputils/mid/plot_feasible_line.py(plotting migrated to reports2)Closes #398
Reviewer focus
create_fair_default_tariff.pyimplements a 2×2 Cramer's-rule solve for each strategy — worth a close read to confirm the linear system is assembled correctly relative to the notation incontext/methods/tou_and_rates/fair_default_rate_design.md.1a57bfcandf7d9c02extend the feasible-line computation to work across arbitrary seasonal rate combinations, not just the (F, r_sum) plane — verify the parameterisation matches the math doc.validate_config.py; spot-check NYSEG and RGE since they have the most complex gas/seasonal structures.Non-obvious implementation details
rho_MC = kWh_win_hp / kWh_sum_hp(demand-weighted, not MC-weighted — seecompute_tou.py), which keeps the seasonal differential cost-reflective without requiring a separate MC time-series input at tariff-solve time.prepare_fair_default_tariffs.pyorchestration layer is intentionally thin: it callscompute_fair_default_inputs→create_fair_default_tariffper utility per strategy and writes calibrated JSONs back intoconfig/tariffs/electric/, matching the same promotion pattern used by the seasonal-discount workflow.ad6208c) because it lives in reports2'sfair_default_feasible_line.qmdnotebook — keeping visualisation out of the platform keeps the dependency boundary clean.