Repository navigation
The city-level advanced DST sends waste no listed landfill takes to other landfills - #90
Merged
HughRunyan merged 4 commits intoOct 20, 2026
Conversation
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>
2 tasks done
There was a problem hiding this comment.
🟡 Changes recommended
The request rewrite rejects empty scenario timelines instead of preserving the existing baseline fallback.
1 open issue
What changed in this PR
Adds optional “other landfills” to city-level advanced DST, routing unassigned waste without requiring callers to provide a complete landfill list.
Changes:
- Rewrites requests to include a residual landfill across all three entry points.
- Adds routing, validation, and equivalence tests.
- Documents the new behavior in the changelog.
| File | Description |
|---|---|
| tests/test_adst_city_other_landfills.py | Tests residual routing and existing behavior compatibility. |
| SWEET_python/advanced_dst_city.py | Adds the optional landfill specification and request rewrite. |
| changelog/2026-10.md | Documents the feature and output ordering. |
Review effort: Balanced
… landfills
_with_other_landfills read each variant's split through variant_get, which
falls back to the baseline only on None, so scenario: {} raised
"landfill_split_timeline is required" in all three entry points. The run
itself treats an empty scenario split as the baseline's; the rewrite now does
too. Found by Copilot on #90.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 tasks done
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.

What changed
AdvancedDSTCityRequestgains an optionalother_landfills: a landfill spec (OtherLandfillsSpec) with no open or close years and no gate total. When it is given:landfillsmay be empty.landfill_split_timelineis required only whenlandfillslists any.How:
run_advanced_dst_city,run_advanced_dst_city_defaultsandrun_advanced_dst_city_limitseach start by rewriting the request with other landfills listed as one more landfill (_with_other_landfills). That landfill opens with the model (1970, or a listed site's earlier opening) and never closes. Nothing downstream changes, so the run is the same, bit for bit, as one that lists that landfill at the leftover share. Other landfills come last insite_emissions, in the mass flow'ssitesand in the defaults.Why: in the advanced DST's city mode, users have to make their site shares add up to 100%, or the frontend quietly scales them. WasteMAP's site list is incomplete, so most users can't name every site. With this, the WasteMAP frontend can send the shares users typed and let the model route the rest to "other landfills". The paired WasteMAP PR, RMI/WasteMAP#887, picks each city’s default type for other landfills and does the frontend work. Merge this one first.
User story: as an advanced DST user with data for a city and a few of its landfills, I want the waste I haven't assigned to go to a sensible default landfill, so that each site is modelled at the share I gave it and the city total still covers all of its waste.
Does this change a line marked
# decision:?Do model numbers change?
other_landfillsrun exactly as before, and SWEET's full fast suite passes locally (596 tests).model-output-change, and the changelog entry says how much they move.Acceptance criteria
other_landfills, listed shares summing to 0.625 leave 0.375 to other landfills.landfills: []withother_landfillsruns. Withoutother_landfillsit is refused.other_landfills, shares must still sum to ~1.run_advanced_dst_city_defaultsandrun_advanced_dst_city_limitstake the same request.Definition of done
tests/test_adst_city_other_landfills.pyadds 18 tests🤖 Generated with Claude Code