From b35e77ccd0c3213376a5466e308c3a5b51f33301 Mon Sep 17 00:00:00 2001 From: HughRunyan Date: Tue, 26 May 2026 09:03:17 -0700 Subject: [PATCH 1/2] wp-290 --- SWEET_python/city_params.py | 12 ------------ SWEET_python/defaults_2019.py | 5 ++--- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/SWEET_python/city_params.py b/SWEET_python/city_params.py index 21d6879..3af0151 100644 --- a/SWEET_python/city_params.py +++ b/SWEET_python/city_params.py @@ -978,7 +978,6 @@ def load_andre_params(self, row, backfill=False): * 1.1023 * 0.7 ) # / 28 - # Unit is Mg CO2e/Mg of organic waste, wtf, so convert to CH4. Mistake in sweet here except: mef_compost = 0 @@ -3078,7 +3077,6 @@ def import_basics(self, row) -> None: * 1.1023 * 0.7 ) # / 28 - # Unit is Mg CO2e/Mg of organic waste, wtf, so convert to CH4. Mistake in sweet here mef_compost = mef_compost.at[2000] except: mef_compost = 0 @@ -3496,7 +3494,6 @@ def _is_transient_db_error(err: Exception) -> bool: * 1.1023 * 0.7 ) # / 28 - # Unit is Mg CO2e/Mg of organic waste, wtf, so convert to CH4. Mistake in sweet here mef_compost = mef_compost.at[2000] except: mef_compost = 0 @@ -3775,7 +3772,6 @@ def _is_transient_db_error(err: Exception) -> bool: * 1.1023 * 0.7 ) # / 28 - # Unit is Mg CO2e/Mg of organic waste, wtf, so convert to CH4. Mistake in sweet here mef_compost = mef_compost.at[2000] except: mef_compost = 0 @@ -5687,14 +5683,6 @@ def _check_masses_v2( ) ) - # Make sure at some point this doesn't do crazy shit when implement_year is early or something - # if isinstance(parameters.waste_mass, dict): - # ratio = parameters.waste_mass['scenario'] / parameters.waste_mass['baseline'] - # div_masses_df.compost.loc[parameters.implement_year:, :] *= ratio - # div_masses_df.anaerobic.loc[parameters.implement_year:, :] *= ratio - # div_masses_df.recycling.loc[parameters.implement_year:, :] *= ratio - # div_masses_df.combustion.loc[parameters.implement_year:, :] *= ratio - try: # Create the final instances final_div_masses_annual = DivMassesAnnual( diff --git a/SWEET_python/defaults_2019.py b/SWEET_python/defaults_2019.py index 9e2dc47..aa35d57 100644 --- a/SWEET_python/defaults_2019.py +++ b/SWEET_python/defaults_2019.py @@ -285,7 +285,6 @@ def _find_iso3_csv() -> Path: waste_fraction_defaults = waste_fraction_defaults.drop("total", axis=1) # waste_fraction_defaults.head() # waste_fraction_defaults = waste_fraction_defaults.T.to_dict() -# Ah shit hungary is wrong. waste_fractions_country = { "Kazakhstan": [21.5, 2.8, 26.5, 0.0, 7.0, 0.0, 0.0, 16.8, 1.5, 11.8, 11.9], "Uzbekistan": [38.4, 0.0, 22.8, 4.9, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 34.0], @@ -953,8 +952,8 @@ def get_precipitation_zone(rainfall): "remediated_to_landfill": 0.1, }, } -# mef_compost = 0.005876238822222 # Unit is Mg CO2e/Mg of organic waste, wtf -mef_anaerobic = 0.26 / 1000 * 1.1023 # Unit is Mg CH4/Mg organic waste...wtf + +mef_anaerobic = 0.26 / 1000 * 1.1023 ch4_to_co2e = 28 gas_capture_efficiency = {"landfill": 0.6, "controlled_dumpsite": 0.45, "dumpsite": 0} landfill_default_regions = set( From b37235118b4278ee15dbca160ab915dbfba083cd Mon Sep 17 00:00:00 2001 From: HughRunyan Date: Tue, 26 May 2026 13:16:12 -0700 Subject: [PATCH 2/2] cleaning --- SWEET_python/city_params.py | 2 +- SWEET_python/defaults_2019.py | 4 ++-- SWEET_python/singapore_k/singapore_k.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/SWEET_python/city_params.py b/SWEET_python/city_params.py index 3af0151..29745fa 100644 --- a/SWEET_python/city_params.py +++ b/SWEET_python/city_params.py @@ -12,7 +12,7 @@ from typing import List, Dict, Union, Any, Set, Optional import pandas as pd import numpy as np -import pycountry # What am i using this for...seems dumb +import pycountry # TODO: confirm whether this import is still needed. from SWEET_python.class_defs import * import copy from geopy.geocoders import Nominatim diff --git a/SWEET_python/defaults_2019.py b/SWEET_python/defaults_2019.py index aa35d57..b3e1617 100644 --- a/SWEET_python/defaults_2019.py +++ b/SWEET_python/defaults_2019.py @@ -966,9 +966,9 @@ def get_precipitation_zone(rainfall): "Western Europe", ] ) -# These numbers are kind of weird. I think... +# These numbers need additional review. # Does this mean...waste that isn't diverted? But also is landfilled, as opposed to untracked? -# These are from IPCC, regions are slightly weird....SWEET has Central and Southern Asia, IPCC has south central and western...using south central for western here. +# These are from IPCC. SWEET has Central and Southern Asia, while IPCC has south central and western; using south central for western here. # Africa is a single average and rest of oceania is from aus/nz fraction_open_dumped = { "Australia and New Zealand": 0.0, diff --git a/SWEET_python/singapore_k/singapore_k.py b/SWEET_python/singapore_k/singapore_k.py index 1d01095..6c3731c 100644 --- a/SWEET_python/singapore_k/singapore_k.py +++ b/SWEET_python/singapore_k/singapore_k.py @@ -93,7 +93,7 @@ def _build_lookup_array(): lookup_array[1, 5, 0] = 0.7 lookup_array[2, 5, 0] = 0.5 - # stupid fake one i need for some reason deal with later + # Placeholder value; confirm whether this case needs a real lookup. lookup_array[1, 5, 2] = 0.5 lookup_array[0, 6, 2] = 0.6