Skip to content

Grow waste on the WPP2024 year-by-year population curve, not a frozen CAGR - #42

Open
HughRunyan wants to merge 1 commit into
mainfrom
wpp-population-growth-model
Open

Grow waste on the WPP2024 year-by-year population curve, not a frozen CAGR#42
HughRunyan wants to merge 1 commit into
mainfrom
wpp-population-growth-model

Conversation

@HughRunyan

Copy link
Copy Markdown
Collaborator

Output

Waste generation grows along the UN WPP2024 medium-variant population series year by year — factor(year) = P(year) / P(pivot) — instead of compounding a single frozen CAGR (growth_rate_*) indefinitely. Within the 1990–2050 horizon this is pure interpolation of the UN's own decelerating trajectory (no extrapolation), so long-run projections are far less dramatic and are citable.

This is the growth-math half of the change; the pipeline half is RMI_Climate_TRACE_Waste_Methane#wpp-population-growth-model. Merge this first — it's the editable dependency.

User story

As a modeller, I want landfill waste to follow the UN's projected population curve so that emission estimates past ~2035 are realistic and defensible instead of exploding on a compounded fixed rate.

What changed

  • growth_factors_for_years() (new, class_defs.py): returns P(year)/P(pivot) when a population_series is supplied, and reproduces the legacy piecewise frozen-CAGR exactly when it is None — so every existing caller is unchanged by default.
  • Threaded an optional population_series through WasteGeneratedDF.create and DivsDF.create / _create_dataframe (default None → old behaviour).
  • _population_series_from_pop_data() (new, city_params.py): pulls pop_1990..pop_2050 for the site's iso3 out of pop_data; returns None (scalar fallback) when the yearly columns or the country are absent. Wired into the TRACE site path.
  • Bug fix — double-applied growth (multi-row TRACE path): growth was applied once while building waste_time_series and again in WasteGeneratedDF.create, turning a 2 %/yr country into ~4 %/yr. For a KEN-like site the 2050/2023 ratio was 3.09; it is now 1.52 (matches the single-row path and the pure WPP curve).
  • Bug fix — anchor mismatch: the multi-row projection pivot was hardcoded to 2020 while the single-row path pivots at the data year; both now pivot at the data year, eliminating a ~6 % offset. Observed values in the reported years are still respected (the reason the time-series path exists).

Acceptance criteria

  • With a population_series, generated waste equals the WPP curve P(year)/P(pivot) exactly.
  • With population_series=None, output is byte-for-byte the legacy frozen-CAGR (backward-compatible default).
  • Growth is applied once, not twice, on the multi-row path.
  • Single- and multi-row paths agree on projected (non-observed) years.
  • No mass-balance regression: scenario diversion stays proportional to generated waste.

Definition of Done

  • Acceptance criteria met
  • Tests pass — 6 WPP regression tests + 113 mitigation-integration tests green (tests/manual in the paired repo, full-dep lane)
  • Reviewed & merged (merge before the paired pipeline PR)

🤖 Generated with Claude Code

… CAGR

Model waste generation with the UN WPP2024 medium-variant population series
year by year -- factor(year) = P(year) / P(pivot) -- instead of compounding a
single frozen CAGR ("growth_rate_*") indefinitely. Within the 1990-2050 horizon
this is pure interpolation of the UN's own decelerating trajectory (no
extrapolation), so long-run projections are far less dramatic and are citable.

- class_defs.growth_factors_for_years(): new helper. When a population_series is
  supplied it returns P(year)/P(pivot); when it is None it reproduces the legacy
  piecewise frozen-CAGR exactly, so every existing caller is unchanged by default.
- Thread an optional population_series through WasteGeneratedDF.create and
  DivsDF.create/_create_dataframe (defaults None -> old behavior).
- city_params._population_series_from_pop_data(): pull pop_1990..pop_2050 for the
  site's iso3 out of pop_data; returns None (scalar fallback) when the yearly
  columns or country are absent. Wired into the TRACE site path.
- Fix double-application of growth on the multi-row TRACE path: growth was applied
  once building waste_time_series and again in WasteGeneratedDF.create, turning a
  2%/yr country into ~4%/yr (2050/2023 ratio 3.09 vs the intended 1.71).
- Unify the multi-row projection pivot to the data year (was hardcoded 2020), so
  the single- and multi-row paths agree on projected years.

Paired with RMI_Climate_TRACE_Waste_Methane branch wpp-population-growth-model.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@HughRunyan HughRunyan added enhancement New feature or request model-output-change Changes model OUTPUT values (expected progress, not breaking); results differ from prior runs labels Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request model-output-change Changes model OUTPUT values (expected progress, not breaking); results differ from prior runs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant