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.
This commit is contained in:
Fabian Neumann 2019-08-10 12:33:14 +02:00 committed by GitHub
parent 07143fb2cd
commit ea96d499e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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")