Grow waste on the WPP2024 year-by-year population curve, not a frozen CAGR - #42
Open
HughRunyan wants to merge 1 commit into
Open
Grow waste on the WPP2024 year-by-year population curve, not a frozen CAGR#42HughRunyan wants to merge 1 commit into
HughRunyan wants to merge 1 commit into
Conversation
… 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>
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.
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): returnsP(year)/P(pivot)when apopulation_seriesis supplied, and reproduces the legacy piecewise frozen-CAGR exactly when it isNone— so every existing caller is unchanged by default.population_seriesthroughWasteGeneratedDF.createandDivsDF.create/_create_dataframe(defaultNone→ old behaviour)._population_series_from_pop_data()(new,city_params.py): pullspop_1990..pop_2050for the site's iso3 out ofpop_data; returnsNone(scalar fallback) when the yearly columns or the country are absent. Wired into the TRACE site path.waste_time_seriesand again inWasteGeneratedDF.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).Acceptance criteria
population_series, generated waste equals the WPP curveP(year)/P(pivot)exactly.population_series=None, output is byte-for-byte the legacy frozen-CAGR (backward-compatible default).Definition of Done
tests/manualin the paired repo, full-dep lane)🤖 Generated with Claude Code