Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions SWEET_python/city_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -1406,11 +1406,12 @@ def load_andre_params(self, row, backfill=False):
self.waste_mass_defaults = True
if iso3 in defaults_2019.msw_per_capita_country:
waste_per_capita = defaults_2019.msw_per_capita_country[iso3]
year_of_data_msw = 2019
else:
waste_per_capita = defaults_2019.msw_per_capita_defaults[region]
year_of_data_msw = 2019
waste_mass_load = waste_per_capita * population / 1000 * 365
# A rate times this population is already the population year's
# waste, so the year adjustment below must not move it again.
year_of_data_msw = int(year_of_data_pop)

# Subtract mass that is informally collected
# self.informal_fraction = np.nan_to_num(row['percent_informal_sector_percent_collected_by_informal_sector_percent']) / 100
Expand Down Expand Up @@ -3372,11 +3373,12 @@ def import_basics(self, row) -> None:
waste_mass_defaults = True
if self.iso3 in defaults_2019.msw_per_capita_country:
waste_per_capita = defaults_2019.msw_per_capita_country[self.iso3]
year_of_data_msw = 2019
else:
waste_per_capita = defaults_2019.msw_per_capita_defaults[self.region]
year_of_data_msw = 2019
waste_mass_load = waste_per_capita * population / 1000 * 365
# A rate times this population is already the population year's
# waste, so the year adjustment below must not move it again.
year_of_data_msw = int(year_of_data_pop)

# Subtract mass that is informally collected
# self.informal_fraction = np.nan_to_num(row['percent_informal_sector_percent_collected_by_informal_sector_percent']) / 100
Expand Down
43 changes: 43 additions & 0 deletions changelog/2026-10.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ A blank or junk country is not found rather than modelled as the UK or Italy,
and the site tool's prefill finds the country for a point in Turkey, both Congos
and eight more places it used to fail on.

A city with no waste figure of its own now generates waste at
its country's per-capita default. `load_andre_params` used to move that default
from 2019 to the city's population year, although it already described the
population year, so the 39 cities that take this path came out up to 35% below
or 9% above the default (model-output change).

## Added

- **Seven more Climate TRACE modelling decisions are marked where SWEET applies them**:
Expand Down Expand Up @@ -392,6 +398,43 @@ and eight more places it used to fail on.
([#80](https://github.com/RMI/SWEET_python/pull/80),
[RMI/WasteMAP#859](https://github.com/RMI/WasteMAP/pull/859))

- **A city with no waste figure generates waste at the default rate**
(model-output change). When a cities-table row has neither
`msw_generated_metric_tons_per_year` nor `msw_collected_metric_tons_per_year`,
`City.load_andre_params` sizes the city's waste as the IPCC per-capita default
(`defaults_2019.msw_per_capita_country`, else the region's
`msw_per_capita_defaults`) times the city's population. That population is
the one for the row's `population_year`, so the mass already describes that
year. The loader labelled it 2019 instead, and the adjustment that moves a
surveyed tonnage from its survey year to the population year then moved it a
second time. The city got the default × P(population year) / P(2019), or the
compounded equivalent for a big city on its own UN rates. The default now
takes the population year as its year, so that adjustment leaves it alone. A
surveyed tonnage is still moved as before.
- **Who moves:** the 39 of 5,962 cities in WasteMAP's June 2026 cities table
with "Defaults Used: Waste Mass". Their waste, and so their CH4, changes by
−7.9% (Abeokuta, population year 2022) to +53.9% (Kano, 2006): 30 rise and
9 fall. Kuwait City goes from 7.92 to 8.36 kg per person per day (+5.5%),
Tel Aviv +14.7%, Melbourne +5.4%. Their 2025 total, 395 kt CH4 as
published, rises by about 27 kt.
- **What else changes for those rows:** "Year of Data Collection (MSW)"
becomes the population year (2005–2022) instead of 2019 (Hugh's call,
2026-10-17). WasteMAP's map build appends that year to the three "Data
Source" columns, so those follow. WasteMAP's API already returns the
population year as `waste_mass_year` (RMI/WasteMAP#860), so the label and
that field now agree.
- **When:** nothing moves until WasteMAP's cities table is rebuilt, because
the map and the City DST read the published table. Climate TRACE doesn't
call `load_andre_params`.
- `City.import_basics`, the SINIR loader, had the same rule and gets the same
fix. Only `model_city_via_sites` reaches it, and nothing calls that.
- The copies in `import_basics_site` are unchanged. They size a site for a
placeholder population of 100, so a default there means nothing either
way, and Climate TRACE drops a site with no tonnage before SWEET runs.

Tests: `tests/test_default_waste_per_capita.py`.
([#79](https://github.com/RMI/SWEET_python/pull/79))

## Known limitations

- **The three regions fall back to all dumpsite, Brunei apart.** Central Asia
Expand Down
2 changes: 1 addition & 1 deletion changelog/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ shows the month up to that release. Entries are not grouped by release.

Newest first:

- [2026-10](2026-10.md) — Indonesia sizes its waste from its own IPCC per-capita row instead of the South-Eastern Asia default, 2.4× higher (model-output change); a site with no recorded type is guessed by Climate TRACE's rule (income, region and named countries) in every SWEET path, moving 55 countries' unknown sites from open dump to sanitary landfill in the site tool (model-output change); gas collection efficiency and oxidation follow a site's reports year by year on rows that carry their year, and a modelled site keeps its measured efficiency (no output change on current data); `load_csv_new` normalizes a city's composition as the other loaders do, so WasteMAP's city DST runs for São Paulo (99%) and Brasília (87%), whose every scenario it rejected as "Invalid waste fractions"; the city DST of Brazil's precomputed cities scales by 100 ÷ their published sum (Brasília +14.9%, most −0.1%), and the no-change scenario reproduces the baseline (model-output change); a Custom Location city models landfill methane in every country: in 31 (Southern Asia, South-Eastern Asia and Southern Africa, which have no regional disposal row, plus Canada, Germany and Switzerland, whose rows are all zeros) its disposal split was (0, 0, 0), so its landfills took none of its waste; it now gets the cities table's split for a city with no landfill data (model-output change); the City DST's "move waste to existing gas capture" slider changes a city's emissions; it computed a new split and never applied it to the landfills, so every setting returned the no-change scenario for the 7 cities with a live slider (its arithmetic also scaled the shares without capture up, not down) (model-output change); the City DST's "add gas capture" lever applies the oxidation it sets (0.22 for the landfill it fits with gas capture, 0.1 for the dumpsite it converts) instead of resetting both to the no-capture defaults at the end of `implement_dst_changes_simple_v1_5`; its results fall another 10–13% after the implementation year, a city that landfills everything from −60% to −65.3% against no change in 2040 (model-output change); a Custom Location in Kosovo builds: SWEET looks a country up in its own table before asking pycountry, which has no Kosovo, so Kosovo's code XKX no longer raises "Country 'XKX' not found." (WasteMAP answered 500), and the name "Kosovo" no longer resolves to Serbia, which the site tool's prefill for a point in Kosovo returned (model-output change for a country given by name); a blank or junk country is not found instead of being modelled as another country (`""` was the UK, `"None"` Italy), and the site tool's prefill finds the country for a point in Turkey, both Congos and eight more places, and says so for a point in none, where it crashed (model-output change for a point in Sint Maarten)
- [2026-10](2026-10.md) — Indonesia sizes its waste from its own IPCC per-capita row instead of the South-Eastern Asia default, 2.4× higher (model-output change); a site with no recorded type is guessed by Climate TRACE's rule (income, region and named countries) in every SWEET path, moving 55 countries' unknown sites from open dump to sanitary landfill in the site tool (model-output change); gas collection efficiency and oxidation follow a site's reports year by year on rows that carry their year, and a modelled site keeps its measured efficiency (no output change on current data); `load_csv_new` normalizes a city's composition as the other loaders do, so WasteMAP's city DST runs for São Paulo (99%) and Brasília (87%), whose every scenario it rejected as "Invalid waste fractions"; the city DST of Brazil's precomputed cities scales by 100 ÷ their published sum (Brasília +14.9%, most −0.1%), and the no-change scenario reproduces the baseline (model-output change); a Custom Location city models landfill methane in every country: in 31 (Southern Asia, South-Eastern Asia and Southern Africa, which have no regional disposal row, plus Canada, Germany and Switzerland, whose rows are all zeros) its disposal split was (0, 0, 0), so its landfills took none of its waste; it now gets the cities table's split for a city with no landfill data (model-output change); the City DST's "move waste to existing gas capture" slider changes a city's emissions; it computed a new split and never applied it to the landfills, so every setting returned the no-change scenario for the 7 cities with a live slider (its arithmetic also scaled the shares without capture up, not down) (model-output change); the City DST's "add gas capture" lever applies the oxidation it sets (0.22 for the landfill it fits with gas capture, 0.1 for the dumpsite it converts) instead of resetting both to the no-capture defaults at the end of `implement_dst_changes_simple_v1_5`; its results fall another 10–13% after the implementation year, a city that landfills everything from −60% to −65.3% against no change in 2040 (model-output change); a Custom Location in Kosovo builds: SWEET looks a country up in its own table before asking pycountry, which has no Kosovo, so Kosovo's code XKX no longer raises "Country 'XKX' not found." (WasteMAP answered 500), and the name "Kosovo" no longer resolves to Serbia, which the site tool's prefill for a point in Kosovo returned (model-output change for a country given by name); a blank or junk country is not found instead of being modelled as another country (`""` was the UK, `"None"` Italy), and the site tool's prefill finds the country for a point in Turkey, both Congos and eight more places, and says so for a point in none, where it crashed (model-output change for a point in Sint Maarten); a city with no waste figure of its own generates waste at its country's per-capita default, instead of having that default moved a second time as if it described 2019; the 39 such cities in WasteMAP's cities table change by −8% to +54% (model-output change)
- [2026-09](2026-09.md) — WasteMAP's site tool, city tool and Custom Location grow waste with the country's UN population year by year, as Climate TRACE does; big cities keep their own UN city rates (model-output change); model output frames get one fixed waste-type column order instead of a per-process one (a `set` fed the ordering, and Python randomizes set iteration per process), moving values in the last bit only, where a sum runs across the reordered columns; City DST's diversion sum stops passing pandas a keyword pandas is removing, which would have broken the model path on pandas 4 behind a misleading `AttributeError` (no output change); annual model no longer charges a flare's inefficiency twice (a hardcoded 2% slip stacked on the `flaring` destruction efficiency), so it agrees with the monthly model again and a site with gas capture emits ~3.5% less (model-output change); `gas_capture_efficiency` bounded to [0, 1], where an out-of-range value used to produce negative emissions silently; one methane density constant instead of two 9.1% apart
- [2026-08](2026-08.md) — Single-site adst gains optional `depth` (deep-dump MCF bump) and `k_override` (caller-supplied decomposition rate) inputs, restoring the last two site-DST levers; `/sdst` flaring efficiency reaches the model again after a variable-name bug silently forced flare destruction to 0.98; annual model applies cover oxidation by emission year not deposit year, fixing biocover having no effect on closed landfills (WasteMAP #719); `City.sdst_v1_5` custom-site path holds the scenario equal to the baseline before the implementation year even when composition changes (was back-dating the new composition onto pre-implementation deposits) (model-output change); MCF consolidated into a new `SWEET_python.mcf` module and both dump types moved to the IPCC uncategorised-SWDS 0.6 (open dumps up from 0.4, controlled dumps down from 0.7), with a supplied depth now selecting the deep/shallow category (model-output change)
- [2026-07](2026-07.md) — All ten waste types eligible for combustion (metal/glass/other added); methane-only model treats combustion as landfill diversion (model-output change)
Expand Down
Loading
Loading