Repository navigation
feat(eeio): electricity generation and a delivery sector behind a flag - #1223
Open
WesIngwersen wants to merge 4 commits into
Open
WesIngwersen wants to merge 4 commits into
WesIngwersen wants to merge 4 commits into
Conversation
…#1217) Adds --electricity-delivery-margin to IV_score, with its own span cache and output folder. The time series emissions now move SF6 and brokers the way the model does, and the delivery split is cleared between years. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Differs from 2026_usa_cornerstone_v1_0 only by electricity_delivery_margin, so diagnostics measure that change alone. The release config stays as it is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Closes #1216. Implements most of #1217, which stays open for the time series rerun. Stacked on #1221. Part of the plan in #902.
Adds the flag
electricity_delivery_margin, off by default, so no config's output changes. With it on, the model has electricity generation in221100and buyer-specific delivery in its own sector, after Step 7. There is no nowcast rebuild, and the 402-sector BEA tables don't change.What the flag does
Keeps 405 sectors (#1216).
425000merges into423A00, and its slot holds delivery. The axes keep the code425000, because released configs and old snapshots use it, and emission factor tables show42ELEC. The Excel commodity sheet keeps the code, since it has to match the matrix axes, and changes the name. A permanent code change can come with the release.Splits electric power (#1217). All in
restructure_tables:221100)gen_idelivery_ireallocate_electricity_coproduction. Electric utilities make $14bn of gas distribution in 2024, and without this it took generation's factor per dollar and rose 62%.A_margingets delivery for electricity, andPhibecomes generation over the bill. So the published purchaser-price factor for electricity combines the two.restructure_tablesraises if delivery's value added doesn't fit electric value added, or if generation output isn't positive.Results with the flag on
Every year builds, 2017-2024. These compare the 2024 model with snapshot
c9b69d94.Nof generation, kg/$Nof delivery, kg/$2024:
N331410+25%,334413+20%,331420+20%221200gas distribution -40%423A00with brokers mergedGas distribution falls 40% because the coproduction step removes electricity's emissions from it. In today's model, 13% of its output comes from the electric industry at electricity's factor. That is a correction to an existing artefact, and it should be read as one.
Inputs plus value added miss output in some columns, by $0.4-1.7bn for generation and the host. This isn't from the split. With the flag off, about 270 sectors have such a gap in 2024, -$181.8bn in total, and the largest are
523A00at -$57.6bn and481000at -$45.3bn. With the flag on, generation's gap barely moves, the host takes over brokers' gap, and delivery has none. The total moves by $0.35bn, mostly517110at -$0.28bn, which isn't explained yet.Diagnostics: 2024 against snapshot
c9b69d94, from2026_usa_cornerstone_v1_0_electricity_delivery_margin, which differs from the v1.0 config only by this flag.Time series
IV_score --electricity-delivery-marginruns the IV score with the flag on for every year, and leaves the configs as written. Its span cache and results go to separate folders, so a flag-on run can't replace the tracker's results.stratified_Enow moves SF6 and brokers' emissions the same way the model does, throughmove_delivery_flows.electricity_deliveryandsector_disagg_pipelineare now inCACHE_BEARING_MODULES, so each year in a loop gets its own split.In one run over all years, generation and delivery output match the single-year runs for each year, and 2024
Nfrom the span equals the model's for every sector. Generation scores an IV of 2.36, delivery 0.01 and423A000.02.Not in this PR
sector_deep_dive_triagehas no flag-on option yet. Split electric power into 221100 generation and 42ELEC delivery, with emissions and margins #1217 stays open for this..SNAPSHOT_KEYbump. The GHG FBS doesn't change.S00700stays as it is. Both are to be reviewed.N_d. The figures above are totalN, as in the diagnostics.Checks
Unit tests cover the row and column identities, value added, losses, emissions, margins and labels, on synthetic tables.
black,ruffandmypyare clean on the changed files. The results above came from local runs of the full model for each year. The suite is left to CI.🤖 Generated with Claude Code