implement analysis for decisions 3, 5, and 7 in dicussion #85#481
implement analysis for decisions 3, 5, and 7 in dicussion #85#481jvendries wants to merge 7 commits into
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
5189c68 to
ff7e43e
Compare
b0debb2 to
8233e92
Compare
|
Report from the analysis on this branch can be found in this discussion_85_analysis_report.md |
92c2478 to
4686d0d
Compare
ff7e43e to
03cd4d0
Compare
…roduction based splits
4686d0d to
584e55a
Compare
03cd4d0 to
7f6de22
Compare
These AI-generated reports are just unreadable to an extent. This needs some human interpretation. |
|
I ran |

cc: cornerstone-data/methods#85
Closes:
What changed? Why?
Adds a new
d_85analysis module underbedrock/analysis/electricity/to support the methods discussion #85 resolution analysis covering Decisions 3, 5, and 7.Decision 3 explores using EPA Table 8.3 IOU expense shares (Production/Transmission/Distribution) as an alternative to UGO305-A gross output weights for the Use-intersection step. Two variants are implemented:
d8_mixed(Table 8.3 weights for the Use intersection only) andd8_offdiag(a full 3×3 absolute-dollar intersection matrix where generation columns are forced diagonal per Rules D1/D2).Decision 5 introduces price-differentiated commodity row splits using EIA Table 2.4 retail electricity prices (cents/kWh) by end-use sector (Residential, Commercial, Industrial, Transportation). Each purchaser column is assigned an EPA end-use class via a rule-based NAICS chapter mapping, and weights are tilted by the ratio of that sector's price to the national average.
Decision 7 simulates differentiated UGO305 year-scaling by computing per-child GO ratios (generation/transmission/distribution) between the 2017 detail year and the IO target year, with a pure variant and an anchored variant that preserves the weighted mean against the Utilities summary ratio.
A
derive_post_reallocation_checkpoint()helper is extracted intodisaggregation_matrices.pyso the stage-2 IO state (post-reallocation, pre-disaggregation) can be shared cleanly between the existing pipeline and the new scenario analysis. The existing_build_stage_tablesfunction is updated to call this helper rather than duplicating the logic.Each decision has a corresponding report builder that writes an Excel workbook to
d_85/output/(gitignored). A CLI entry point (run_resolution_analysis.py) accepts--decision 3|5|7|alland a config name argument.Testing
Unit tests cover:
table83_go_weightsnormalization and orderingbuild_ugo_col_table83_row_intersection_matrixcolumn-sum (Rule D1) and total preservation, including a worked numeric exampleapply_use_intersection_customtotal preservation and aggregate cell zeroingsplit_y_commodity_row_by_columnaggregate row removaltable_8_3_gtd_expenses_musdandtable_2_4_prices_cents_kwhvalue extraction and missing-flow error raisingclassify_industry_end_userule coverage andbuild_price_tilt_weights_by_columnper-column normalizationcompute_balance_metricsshape and zero relative error on balanced inputs;va_summary_by_scenarionegative VA flaggingdiff_ef_vectorsskippingmetrics_onlyscenarios;report_metadatakey presence_run_baselineparity against the productiondisaggregate_electricity_make_use_vapath (V, Udom, Uimp, VA, Y, q, x all match withinDISAGG_BALANCE_ATOL)d8_mixedscenario routing Table 8.3 weights to the Use-intersection stepp24_2017per-column weight normalizationbuild_ugo305_detail_ratiosratio computation andbuild_anchored_overridesweighted-mean preservationderive_Aq_from_scenario,scenario_vnorm, and_apply_electricity_q_overridesshape and value correctness