Repository navigation
A Custom Location can grow along a stored country trajectory - #94
Merged
Merged
Conversation
…o SWEET city_population_trajectory and country_population_trajectory give a city's or a country's population in every model year, with what its shape comes from, and load_csv_new takes a stored trajectory as population_series. WasteMAP's map build stores them so its city DST grows a city the way the build did. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rounding to whole people bent the curve of the few places WPP interpolates (Svalbard and Jan Mayen: 2,591.78 people in 2022, the 1975/2022 ratio off by 0.03%), so a Custom Location there would not grow as dst_baseline_blank does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
City.dst_baseline_blank takes population_series, as load_csv_new does: the country's population by year from country_population_trajectory, which WasteMAP's map build stores. The Custom Location's waste, and its scenario's, grow along it instead of along SWEET's own table; the tonnage still comes from the population given, and the two rates a person reads stay the country's. Without it nothing changes. Handed the country's own trajectory, every country's Custom Location comes out within 5.9e-16 of before, and the 12 with fallback rates exactly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
2 tasks done
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
The optional override follows existing growth paths, has targeted regression coverage, and has no identified blocking issues.
No open issues 🎉
What changed in this PR
Extends #91’s stored population trajectories to Custom Locations, keeping their waste growth aligned with WasteMAP’s stored build data.
Changes:
- Adds optional
population_seriessupport while preserving population-based tonnage, reported growth rates, and default behavior. - Tests baseline growth, fallback equivalence, and scenario growth.
- Documents the feature in the changelog.
| File | Description |
|---|---|
| tests/test_population_trajectory.py | Tests stored trajectories and Custom Location behavior. |
| SWEET_python/city_params.py | Adds trajectory helpers and optional stored-series growth. |
| changelog/2026-10.md | Documents trajectory support and numerical compatibility. |
Review effort: Balanced
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.
Stacked on #91. Merge #91 first; this PR then targets
main.What
City.dst_baseline_blanktakespopulation_series, the same wayload_csv_newdoes since #91: the country's population by year fromcountry_population_trajectory, which WasteMAP's map build stores. A Custom Location's waste, and its scenario's, grow along it instead of along SWEET's ownpops_yearly.csv. The tonnage still comes from the population passed in; the two growth rates a person reads (growth_rate_historic/growth_rate_future) are still the country's, as inload_csv_new. Without the argument nothing changes.As a WasteMAP maintainer, I want the city DST's Custom Location to grow along the same stored country trajectory as everything else, so that a SWEET pin change can't make it grow differently from the build behind it.
Does any number move?
Checked every country SWEET knows (250; a 1,000,000-person Custom Location; baseline emissions and waste by year), SWEET's table vs the stored trajectory (after #91's 67e21ca, which keeps the UN's fractions of a person):
Acceptance criteria
dst_baseline_blank(..., population_series=s)grows the baseline and scenario waste alongs / s[2022].Tests: 3 new in
tests/test_population_trajectory.py(fail before the change). Full suite: 572 passed.Paired WasteMAP PR: RMI/WasteMAP#890. Same change on the ADST branch: #95 (with RMI/WasteMAP#891).
Definition of Done
Acceptance criteria met · tests pass · changelog updated · reviewed & merged.
🤖 Generated with Claude Code