Skip to content

SWEET's advanced DST branch: a Custom Location can grow along a stored country trajectory - #95

Merged
HughRunyan merged 10 commits into
am-waste-flowfrom
adst-custom-location-grows-along-stored-country
Oct 20, 2026
Merged

HughRunyan merged 10 commits into
am-waste-flowfrom
adst-custom-location-grows-along-stored-country

Conversation

@HughRunyan

@HughRunyan HughRunyan commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #92. Merge #92 first; this PR then targets adst-city-routes-the-rest-to-other-landfills (or wherever #92 lands).

The same change as #94, cherry-picked onto SWEET's advanced DST branch: City.dst_baseline_blank takes population_series, the country's stored population by year, and grows a Custom Location along it instead of SWEET's own table. Without the argument nothing changes.

WasteMAP's ADST branch (RMI/WasteMAP#891) needs it because its _custom_location now passes the stored country row, the same row the advanced DST's prefill already serves a Custom Location (adst_population_trajectory.for_country). So the two tools grow a Custom Location along one stored row.

Numbers: 250 countries checked; 12 fallback-rate places bit-identical, the other 238 within 5.9e-16.

Acceptance criteria

  • Same as the main-side PR, on this branch.
  • Full suite: 608 passed.

Definition of Done

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

🤖 Generated with Claude Code

HughRunyan and others added 8 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>
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>
@HughRunyan HughRunyan added the enhancement New feature or request label Oct 20, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Base automatically changed from adst-population-trajectories to am-waste-flow October 20, 2026 16:29
@HughRunyan
HughRunyan requested a balanced review from Copilot October 20, 2026 16:30

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.

🟡 Changes recommended

Other-landfill routing rejects valid empty scenario timelines and permits negative waste allocations.

2 open issues
What changed in this PR

Adds stored population trajectories to SWEET’s advanced DST branch so Custom Locations can follow WasteMAP’s stored country growth.

Changes:

  • Adds trajectory helpers and optional stored-population inputs.
  • Routes leftover city waste to optional “other landfills.”
  • Adds regression tests and changelog documentation.
File Description
tests/​test_population_trajectory.py Tests stored trajectories and Custom Location growth.
tests/​test_adst_city_other_landfills.py Tests leftover routing and request validation.
SWEET_python/​city_params.py Adds trajectory helpers and stored-population support.
SWEET_python/​advanced_dst_city.py Adds other-landfill routing across entry points.
changelog/​2026-10.md Documents trajectory and landfill-routing features.

Review effort: Balanced

Comment thread SWEET_python/advanced_dst_city.py Outdated
Comment thread SWEET_python/advanced_dst_city.py
…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
HughRunyan merged commit ea02a5b into am-waste-flow Oct 20, 2026
2 checks passed
@HughRunyan
HughRunyan deleted the adst-custom-location-grows-along-stored-country branch October 20, 2026 18:29
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