From ea96d499e74e9b20dddd8e8e35ac7d502120ba70 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Sat, 10 Aug 2019 12:33:14 +0200 Subject: [PATCH] base_network: scale snapshot weightings to sum up to 1 year If the user selects a date range of less than a year in `config.yaml` the snapshot weightings should be scaled to add up to represet 8760 hours (1 year) such that operational expenses and investments are aligned in the objective function. --- scripts/base_network.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/base_network.py b/scripts/base_network.py index 3c74a94b..b23fa0c1 100644 --- a/scripts/base_network.py +++ b/scripts/base_network.py @@ -461,6 +461,7 @@ def base_network(): n.name = 'PyPSA-Eur' n.set_snapshots(pd.date_range(freq='h', **snakemake.config['snapshots'])) + n.snapshot_weightings[:] *= 8760./n.snapshot_weightings.sum() n.import_components_from_dataframe(buses, "Bus") n.import_components_from_dataframe(lines, "Line")