From 79f443ecbd2fcaf0a350d27c4c12ba5f56f503a4 Mon Sep 17 00:00:00 2001 From: yerbol-akhmetov Date: Wed, 20 Dec 2023 22:41:11 +0600 Subject: [PATCH 1/2] fix f weighting for retro cost --- scripts/prepare_sector_network.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/prepare_sector_network.py b/scripts/prepare_sector_network.py index 8a4f98ce..bf179451 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -1986,7 +1986,12 @@ def add_heat(n, costs): ct = pop_layout.loc[node, "ct"] # weighting 'f' depending on the size of the population at the node - f = urban_fraction[node] if "urban" in name else (1 - urban_fraction[node]) + if "urban central" in name: + f = dist_fraction[node] + elif "urban decentral" in name: + f = urban_fraction[node] - dist_fraction[node] + else: + f = 1 - urban_fraction[node] if f == 0: continue # get sector name ("residential"/"services"/or both "tot" for urban central) From 20b847c62743690009a8ff3e18832ec02eb65c6b Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Thu, 21 Dec 2023 13:34:55 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- 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 bf179451..ed9c0bc6 100644 --- a/scripts/prepare_sector_network.py +++ b/scripts/prepare_sector_network.py @@ -1991,7 +1991,7 @@ def add_heat(n, costs): elif "urban decentral" in name: f = urban_fraction[node] - dist_fraction[node] else: - f = 1 - urban_fraction[node] + f = 1 - urban_fraction[node] if f == 0: continue # get sector name ("residential"/"services"/or both "tot" for urban central)