Merge pull request #1243 from PyPSA/fix_msw_stores

fix municipal waste store timeseries
This commit is contained in:
lisazeyen 2024-08-29 15:59:46 +02:00 committed by GitHub
commit 35e81b90a5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 3 deletions

View File

@ -1066,7 +1066,9 @@ def build_eurostat_co2(eurostat: pd.DataFrame, year: int = 1990) -> pd.Series:
# emissions in tCO2_equiv per MWh_th
specific_emissions["Solid fossil fuels"] = 0.36 # Approximates coal
specific_emissions["Oil and petroleum products"] = 0.285 # Average of distillate and residue
specific_emissions["Oil and petroleum products"] = (
0.285 # Average of distillate and residue
)
specific_emissions["Natural gas"] = 0.2 # For natural gas
return eurostat_year.multiply(specific_emissions).sum(axis=1)
@ -1099,7 +1101,9 @@ def build_co2_totals(
co2 = eea_co2.reindex(countries)
for ct in pd.Index(countries).intersection(["BA", "RS", "AL", "ME", "MK", "UA", "MD"]):
for ct in pd.Index(countries).intersection(
["BA", "RS", "AL", "ME", "MK", "UA", "MD"]
):
mappings = {
"electricity": (ct, "+", "Electricity & heat generation", np.nan),
"residential non-elec": (ct, "+", "+", "Residential"),

View File

@ -2345,7 +2345,12 @@ def add_biomass(n, costs):
carrier="municipal solid waste",
)
e_max_pu = pd.Series([1] * (len(n.snapshots) - 1) + [0], index=n.snapshots)
e_max_pu = np.array(
len(spatial.msw.nodes) * [[1] * (len(n.snapshots) - 1) + [0]]
).T
e_max_pu = pd.DataFrame(
e_max_pu, index=n.snapshots, columns=spatial.msw.nodes
).astype(float)
n.madd(
"Store",
spatial.msw.nodes,