Skip to content

SWEET's advanced DST branch can take a stored population trajectory - #92

Merged
HughRunyan merged 8 commits into
am-waste-flowfrom
adst-population-trajectories
Oct 20, 2026
Merged

HughRunyan merged 8 commits into
am-waste-flowfrom
adst-population-trajectories

Conversation

@HughRunyan

Copy link
Copy Markdown
Collaborator

Merge #90 first. This PR is based on #90's branch, so its diff is only the change below. Once #90 is merged into am-waste-flow, GitHub retargets this PR there. I'll then merge am-waste-flow back in so the diff stays clean.

Output

The same change as #91 (into main), for SWEET's advanced DST branch. It is one cherry-picked commit plus its changelog links:

  • city_population_trajectory and country_population_trajectory give a city's or a country's population in people for every model year, and what the shape comes from ("UN city rates", "country curve", "country fallback rates").
  • load_csv_new(..., population_series=) grows a city along a stored trajectory.

Why

WasteMAP's advanced DST now grows a city's waste along the same stored trajectory the city DST uses. Its city prefill serves the trajectory, and the API passes it to load_csv_new. WasteMAP's am-waste-flow builds with this branch of SWEET, so the API there needs these functions. The WasteMAP PR that uses it pins this branch until this merges.

Numbers

No number moves in SWEET: nothing calls the new argument by default. See #91 for why a stored trajectory reproduces SWEET's own growth to ~1e-15 rather than to the bit.

Acceptance criteria

Definition of Done

Acceptance criteria met · tests pass · changelog updated · #90 merged first · reviewed & merged.

🤖 Generated with Claude Code

HughRunyan and others added 6 commits October 19, 2026 20:36
AdvancedDSTCityRequest gains other_landfills: one landfill spec with no
open or close years and no gate total. Each year it takes 1 minus the
shares of the listed landfills open that year, so a caller can state the
sites it knows and leave the rest, without balancing the shares to 1.
A listed landfill's share in years it is shut goes there too, instead of
being spread over the open ones, and a year claiming more than 1 is
scaled down rather than refused. landfills may now be empty.

Every entry point first lists other landfills as one more landfill
(_with_other_landfills), so a run with them is the same run, bit for
bit, as one listing that landfill at the leftover share. Requests
without the field are unchanged.

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>
…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>
…er-landfills' into adst-population-trajectories

# Conflicts:
#	changelog/2026-10.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@HughRunyan HughRunyan added the enhancement New feature or request label Oct 20, 2026
@HughRunyan
HughRunyan requested a balanced review from Copilot October 20, 2026 15:50

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 blocking issues were identified; existing defaults are preserved and focused regression coverage accompanies the changes.

No open issues 🎉

What changed in this PR

Adds stored population trajectories to SWEET’s advanced DST branch, allowing WasteMAP to reuse population growth curves without changing default behavior.

Changes:

  • Adds city and country trajectory helpers and optional population_series loading.
  • Adds regression tests for trajectory generation and reuse.
  • Documents the feature and numerical precision.
File Description
tests/​test_population_trajectory.py Tests trajectory shapes, fallbacks, and loader integration.
SWEET_python/​city_params.py Adds trajectory helpers, stored-series support, and shared fallback constants.
changelog/​2026-10.md Documents stored trajectories and related PRs.

Review effort: Balanced

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>
Base automatically changed from adst-city-routes-the-rest-to-other-landfills to am-waste-flow October 20, 2026 16:26
…ion-trajectories

# Conflicts:
#	SWEET_python/advanced_dst_city.py
#	changelog/2026-10.md
#	tests/test_adst_city_other_landfills.py
@HughRunyan
HughRunyan merged commit 6df9dd4 into am-waste-flow Oct 20, 2026
2 checks passed
@HughRunyan
HughRunyan deleted the adst-population-trajectories branch October 20, 2026 16:29
HughRunyan added a commit that referenced this pull request Oct 20, 2026
…ed-country

#91/#92 were squash-merged, so the base's own files are taken from origin/am-waste-flow and
only this branch's Custom Location change is kept on top.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
HughRunyan added a commit that referenced this pull request Oct 20, 2026
#91/#92 were squash-merged, so the base's own files are taken from origin/main and
only this branch's Custom Location change is kept on top.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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