From fbff32dcfcba57fab3cfaea1e10ae76f1cad75f1 Mon Sep 17 00:00:00 2001 From: Tom Brown Date: Fri, 12 Jan 2024 16:42:12 +0100 Subject: [PATCH] build_pop_weighted_energy: don't reduce district heat share Previously the DH share was being multiplied by the population weighting, reducing the DH share with multiple nodes. --- scripts/build_population_weighted_energy_totals.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/build_population_weighted_energy_totals.py b/scripts/build_population_weighted_energy_totals.py index 879e3b9b..20467f72 100644 --- a/scripts/build_population_weighted_energy_totals.py +++ b/scripts/build_population_weighted_energy_totals.py @@ -26,4 +26,9 @@ if __name__ == "__main__": nodal_energy_totals.index = pop_layout.index nodal_energy_totals = nodal_energy_totals.multiply(pop_layout.fraction, axis=0) + # district heating share should not be divided by population fraction + dh_share = energy_totals["district heat share"].loc[pop_layout.ct].fillna(0.0) + dh_share.index = pop_layout.index + nodal_energy_totals["district heat share"] = dh_share + nodal_energy_totals.to_csv(snakemake.output[0])