From 30bcddb66afb77eba43c842567164aa8688b627c Mon Sep 17 00:00:00 2001
From: Philipp Glaum
Date: Tue, 3 Sep 2024 14:10:20 +0200
Subject: [PATCH 1/3] prepare_sector_networks: account correctely for msw co2
environment.yaml: add license comment
---
envs/environment.fixed.yaml | 10 +++++++---
scripts/prepare_sector_network.py | 13 +++++++------
2 files changed, 14 insertions(+), 9 deletions(-)
diff --git a/envs/environment.fixed.yaml b/envs/environment.fixed.yaml
index d625a5b16..ac2d7eeea 100644
--- a/envs/environment.fixed.yaml
+++ b/envs/environment.fixed.yaml
@@ -1,6 +1,10 @@
+# SPDX-FileCopyrightText: : 2017-2024 The PyPSA-Eur Authors
+#
+# SPDX-License-Identifier: CC0-1.0
+
name: pypsa-eur-20240812
channels:
- - http://conda.anaconda.org/gurobi
- - conda-forge
- - defaults
+- http://conda.anaconda.org/gurobi
+- conda-forge
+- defaults
prefix: /home/fneum/miniconda3/envs/pypsa-eur-20240812
diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py
index 5f579c5d9..89175b1f9 100644
--- a/scripts/prepare_sector_network.py
+++ b/scripts/prepare_sector_network.py
@@ -2377,12 +2377,9 @@ def add_biomass(n, costs):
carrier="municipal solid waste",
)
- 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)
+ e_max_pu = pd.DataFrame(1, index=n.snapshots, columns=spatial.msw.nodes)
+ e_max_pu.iloc[-1] = 0
+
n.madd(
"Store",
spatial.msw.nodes,
@@ -3383,9 +3380,13 @@ def add_industry(n, costs):
spatial.msw.locations,
bus0=spatial.msw.nodes,
bus1=non_sequestered_hvc_locations,
+ bus2="co2 atmosphere",
carrier="municipal solid waste",
p_nom_extendable=True,
efficiency=1.0,
+ efficiency2=-costs.at[
+ "oil", "CO2 intensity"
+ ], # because msw is co2 neutral and will be burned in waste CHP or decomposed as oil
)
n.madd(
From 5e5944df57f1d2b412b7e7eb8d77b5004b97bea6 Mon Sep 17 00:00:00 2001
From: "pre-commit-ci[bot]"
<66853113+pre-commit-ci[bot]@users.noreply.github.com>
Date: Tue, 3 Sep 2024 12:12:20 +0000
Subject: [PATCH 2/3] [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---
doc/release_notes.rst | 4 ++--
doc/tutorial.rst | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/doc/release_notes.rst b/doc/release_notes.rst
index dd39fcbca..2a009fe56 100644
--- a/doc/release_notes.rst
+++ b/doc/release_notes.rst
@@ -100,7 +100,7 @@ PyPSA-Eur 0.12.0 (30th August 2024)
share_unsustainable_use_retained`` and ``biomass:
share_sustainable_potential_available``.
(https://github.com/PyPSA/pypsa-eur/pull/1139)
-
+
* Added energy penalty for BECC applications.
(https://github.com/PyPSA/pypsa-eur/pull/1130)
@@ -258,7 +258,7 @@ PyPSA-Eur 0.12.0 (30th August 2024)
:mod:`prepare_sector_network`. (https://github.com/PyPSA/pypsa-eur/pull/1106)
* Fixed PDF encoding in ``build_biomass_transport_costs``.
- (https://github.com/PyPSA/pypsa-eur/pull/1219)
+ (https://github.com/PyPSA/pypsa-eur/pull/1219)
* Dropped ``pycountry`` dependency in favour of ``country_converter``.
(https://github.com/PyPSA/pypsa-eur/pull/1188)
diff --git a/doc/tutorial.rst b/doc/tutorial.rst
index 73b4df8b8..f514491e2 100644
--- a/doc/tutorial.rst
+++ b/doc/tutorial.rst
@@ -224,7 +224,7 @@ This triggers a workflow of multiple preceding jobs that depend on each rule's i
7 -> 24
26 -> 25
27 -> 25
- }
+ }
|
From 7b98afc85aafd56245ce669873d0c9822c6762c0 Mon Sep 17 00:00:00 2001
From: Philipp Glaum
Date: Tue, 3 Sep 2024 16:02:28 +0200
Subject: [PATCH 3/3] fix if condition to add msw
---
scripts/prepare_sector_network.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py
index 89175b1f9..a83e2d124 100644
--- a/scripts/prepare_sector_network.py
+++ b/scripts/prepare_sector_network.py
@@ -2357,7 +2357,7 @@ def add_biomass(n, costs):
if (
options["municipal_solid_waste"]
and not options["industry"]
- and (cf_industry["waste_to_energy"] or cf_industry["waste_to_energy_cc"])
+ and not (cf_industry["waste_to_energy"] or cf_industry["waste_to_energy_cc"])
):
logger.warning(
"Flag municipal_solid_waste can be only used with industry "