Skip to content

A site can be given a gas capture value for the years it did not report - #135

Merged
HughRunyan merged 2 commits into
mainfrom
unreported-years-take-a-given-capture
Dec 2, 2026
Merged

HughRunyan merged 2 commits into
mainfrom
unreported-years-take-a-given-capture

Conversation

@HughRunyan

@HughRunyan HughRunyan commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

What this does

A site's rows can now say what gas capture to use in the years the site did not report one.

Today, on rows that carry their own year (Climate TRACE's consolidated input), SWEET fills a site's unreported years by carrying the nearest report: the first report back to 1970, each report forward to the next, and the latest forward to 2050. A site whose rows carry the new column gas_collection_efficiency_fill (CAPTURE_FILL_COLUMN in city_params.py) now keeps each reported year's own value and takes that one value in every other year: before the first report, in gaps, and after the last.

If the column is missing or blank, nothing changes. No output moves until a caller sets it. Oxidation is not affected.

Why

Climate TRACE is about to work out each GHGRP landfill's gas capture, year by year, from two figures GHGRP publishes: the methane the site emits and the methane it collects (which GHGRP meters). Those yearly values swing a lot within one site: the median site's own years span 0.25.

Carrying the last reported year (2023) forward to 2050 would make every projected year depend on that one year. On Climate TRACE's frozen 2026-11-09 input, it would move PM after the last report by more than 25% at about 390 of the 1,036 sites, compared with using the site's average. Climate TRACE will set the new column to that average.

Changes

  • city_params.py: CAPTURE_FILL_COLUMN; _carried_series(..., fill=None) uses fill for every year without a report; _resolve_gas_capture reads the column from a site's dated rows (one value per site; several are averaged).
  • tests/test_carried_series.py: 6 new tests. A fill takes the place of carrying, in gaps and at both ends; a blank fill keeps carrying; a fill with nothing reported is used in every year; _resolve_gas_capture uses the column; oxidation ignores it.
  • MODEL_DECISIONS.md: the gas-capture-efficiency entry's Climate TRACE path says the caller may give the value for unreported years.
  • changelog/2026-12.md and the changelog index.

Paired pull request

Climate TRACE: RMI/RMI_Climate_TRACE_Waste_Methane#292. It sets the column and can merge only after a SWEET release that carries this.

Acceptance criteria

  • With gas_collection_efficiency_fill set on a site's dated rows, each reported year keeps its value and every other year takes the fill.
  • With the column missing or blank, the capture series is unchanged from main.
  • Oxidation series are unchanged.
  • All SWEET tests pass.

Definition of done

  • Acceptance criteria met
  • Tests and checks pass (886 passed locally)
  • Docs updated (decision log entry, changelog)
  • Reviewed and merged, then released so Climate TRACE can pin it

🤖 Generated with Claude Code

On rows that carry their own year, SWEET carried a site's first reported
gas collection efficiency back to 1970 and its latest forward to 2050. A
site whose rows carry `gas_collection_efficiency_fill` now keeps each
reported year's value and takes that one value in every other year.
Blank or absent, nothing changes, so no output moves until a caller
sets it. Oxidation is not affected.

Climate TRACE will set it to the average capture a GHGRP site's own
emissions and metered gas imply, so the years after its last report run
at that average rather than at the last year alone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings December 2, 2026 02:02
@HughRunyan HughRunyan added the enhancement New feature or request label Dec 2, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain, and the change includes regression coverage for fill behavior, compatibility fallbacks, and unchanged oxidation handling.

No open issues 🎉

What changed in this PR

Adds optional gas_collection_efficiency_fill support for dated site rows, using the supplied value for unreported years while preserving reported values and legacy behavior when absent or blank.

Changes:

  • Added fill-aware capture resolution and regression tests.
  • Confirmed oxidation handling remains unchanged.
  • Updated model decisions and changelog documentation.
File Description
tests/​test_carried_series.py Adds regression tests for fill behavior, fallback compatibility, and unchanged oxidation handling.
SWEET_python/​MODEL_DECISIONS.md Documents the Climate TRACE gas-capture fill input path.
SWEET_python/​city_params.py Implements the optional capture fill column and fallback resolution logic.
changelog/​README.md Adds the December 2026 changelog index entry.
changelog/​2026-12.md Records the new gas-capture fill feature.

Review effort: Lite

@HughRunyan
HughRunyan merged commit e715b94 into main Dec 2, 2026
2 checks passed
@HughRunyan
HughRunyan deleted the unreported-years-take-a-given-capture branch December 2, 2026 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants