Skip to content

Introduce use_cornerstone_ghg_model bucket flag (GHG model allocation) - #553

Open
briantobin-99 wants to merge 1 commit into
btobin__delete-a-approach-alternativesfrom
btobin__introduce-ghg-model-bucket
Open

Introduce use_cornerstone_ghg_model bucket flag (GHG model allocation)#553
briantobin-99 wants to merge 1 commit into
btobin__delete-a-approach-alternativesfrom
btobin__introduce-ghg-model-bucket

Conversation

@briantobin-99

@briantobin-99 briantobin-99 commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

cc:
Closes:

What changed? Why?

Introduces the "GHG model allocation" bucket flag and dissolves the year-locked inventory flags into the data-year knob:

  • New use_cornerstone_ghg_model: ON = load the pre-built GHG_national_Cornerstone_{usa_ghg_data_year} FBS parquet from GCS (with the eGRID variant when implement_electricity_disaggregation is on); OFF = the GHG_national_CEDA_{year} flowsa FBS (legacy CEDA allocation methodology; raises a clear error for years ≠ 2023, where no CEDA method file exists).
  • Absorbs new_ghg_method (identical mechanism) and v0_3_umd_2024_ghgia (the same mechanism year-locked to 2024). Which inventory and attribution vintages a year carries (EPA GHGI vs UMD GHGIA, MECS survey year) is defined by the per-year method files in transform/ghg/, not by config flags.
  • Deletes update_mecs_method and v0_3_umd_2023_ghgia — intermediate 2023 inventory states that never shipped — along with their now-unselectable variant method files (GHG_national_Cornerstone_2023_{ghgi_mecs,umd_ghgia}.yaml) and the duplicated year-guard blocks (_select_flowsa_ghg_method is gone; selection lives in one place in load_E_from_flowsa).
  • The mutual-exclusion validator with use_ghg_national_2023_m2 carries over to the new flag.

Config migration: 2025_usa_cornerstone_v0_3.yaml, the v03_waterfall_* configs, and the electricity configs swap their new_ghg_method / v0_3_umd_2024_ghgia keys for use_cornerstone_ghg_model. Under the new scheme, the waterfall G2→G3 diff ("US data update") is purely usa_ghg_data_year: 2023 → 2024.

Testing

Unit suite, black, ruff, and mypy green. derive_E_usa() under 2025_usa_cornerstone_v0_3 matches the pinned E_USA_ES snapshot exactly (max abs diff 0.0). Snapshot integration suite (test_integration run) passes on the stack including this change.

@bl-young bl-young added the cleanup Code to be cleaned up label Jul 30, 2026
@briantobin-99
briantobin-99 force-pushed the btobin__introduce-ghg-model-bucket branch from 07ea65e to 399da38 Compare July 30, 2026 18:52
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@briantobin-99
briantobin-99 force-pushed the btobin__introduce-ghg-model-bucket branch from 399da38 to 9fa0b3f Compare July 30, 2026 23:56
@briantobin-99
briantobin-99 requested a review from bl-young July 31, 2026 00:09
@briantobin-99
briantobin-99 marked this pull request as ready for review July 31, 2026 00:09
v0_3_umd_2024_ghgia: bool = False # DRI: catherine.birney
# "GHG model allocation" bucket: Cornerstone GHG FBS (pre-built parquet at
# usa_ghg_data_year) vs the legacy CEDA-methodology FBS (2023 only).
use_cornerstone_ghg_model: bool = False

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be true by default?

use_ghg_national_2023_m2: true

# Must remain false whenever use_ghg_national_2023_m2 is true.
new_ghg_method: false

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we do set the default to be True this will need to be revised

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Code to be cleaned up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants