Merge branch 'master' into snakemake_dependencies_in_functions
This commit is contained in:
commit
418ce4be28
@ -1,3 +1,7 @@
|
|||||||
|
# SPDX-FileCopyrightText: : 2021 The PyPSA-Eur Authors
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
.snakemake
|
.snakemake
|
||||||
.git
|
.git
|
||||||
.pytest_cache
|
.pytest_cache
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
# SPDX-FileCopyrightText: : 2021 The PyPSA-Eur Authors
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
|
||||||
.snakemake
|
.snakemake
|
||||||
.git
|
.git
|
||||||
.pytest_cache
|
.pytest_cache
|
||||||
@ -11,9 +15,9 @@ __pycache__
|
|||||||
notebooks
|
notebooks
|
||||||
benchmarks
|
benchmarks
|
||||||
logs
|
logs
|
||||||
resources
|
resources*
|
||||||
results
|
results
|
||||||
networks
|
networks*
|
||||||
cutouts
|
cutouts
|
||||||
data/bundle
|
data/bundle
|
||||||
doc
|
doc
|
@ -67,7 +67,14 @@ if config['enable'].get('retrieve_databundle', True):
|
|||||||
script: 'scripts/retrieve_databundle.py'
|
script: 'scripts/retrieve_databundle.py'
|
||||||
|
|
||||||
|
|
||||||
|
rule retrieve_load_data:
|
||||||
|
input: HTTP.remote("data.open-power-system-data.org/time_series/2019-06-05/time_series_60min_singleindex.csv", keep_local=True, static=True)
|
||||||
|
output: "data/load_raw.csv"
|
||||||
|
shell: "mv {input} {output}"
|
||||||
|
|
||||||
|
|
||||||
rule build_load_data:
|
rule build_load_data:
|
||||||
|
input: "data/load_raw.csv"
|
||||||
output: "resources/load.csv"
|
output: "resources/load.csv"
|
||||||
log: "logs/build_load_data.log"
|
log: "logs/build_load_data.log"
|
||||||
script: 'scripts/build_load_data.py'
|
script: 'scripts/build_load_data.py'
|
||||||
|
@ -188,7 +188,6 @@ transformers:
|
|||||||
type: ''
|
type: ''
|
||||||
|
|
||||||
load:
|
load:
|
||||||
url: https://data.open-power-system-data.org/time_series/2019-06-05/time_series_60min_singleindex.csv
|
|
||||||
power_statistics: True # only for files from <2019; set false in order to get ENTSOE transparency data
|
power_statistics: True # only for files from <2019; set false in order to get ENTSOE transparency data
|
||||||
interpolate_limit: 3 # data gaps up until this size are interpolated linearly
|
interpolate_limit: 3 # data gaps up until this size are interpolated linearly
|
||||||
time_shift_for_large_gaps: 1w # data gaps up until this size are copied by copying from
|
time_shift_for_large_gaps: 1w # data gaps up until this size are copied by copying from
|
||||||
|
@ -150,7 +150,6 @@ transformers:
|
|||||||
type: ''
|
type: ''
|
||||||
|
|
||||||
load:
|
load:
|
||||||
url: https://data.open-power-system-data.org/time_series/2019-06-05/time_series_60min_singleindex.csv
|
|
||||||
power_statistics: True # only for files from <2019; set false in order to get ENTSOE transparency data
|
power_statistics: True # only for files from <2019; set false in order to get ENTSOE transparency data
|
||||||
interpolate_limit: 3 # data gaps up until this size are interpolated linearly
|
interpolate_limit: 3 # data gaps up until this size are interpolated linearly
|
||||||
time_shift_for_large_gaps: 1w # data gaps up until this size are copied by copying from
|
time_shift_for_large_gaps: 1w # data gaps up until this size are copied by copying from
|
||||||
|
@ -240,7 +240,7 @@ def mock_snakemake(rulename, **wildcards):
|
|||||||
if os.path.exists(p):
|
if os.path.exists(p):
|
||||||
snakefile = p
|
snakefile = p
|
||||||
break
|
break
|
||||||
workflow = sm.Workflow(snakefile)
|
workflow = sm.Workflow(snakefile, overwrite_configfiles=[])
|
||||||
workflow.include(snakefile)
|
workflow.include(snakefile)
|
||||||
workflow.global_resources = {}
|
workflow.global_resources = {}
|
||||||
rule = workflow.get_rule(rulename)
|
rule = workflow.get_rule(rulename)
|
||||||
|
@ -14,7 +14,6 @@ Relevant Settings
|
|||||||
snapshots:
|
snapshots:
|
||||||
|
|
||||||
load:
|
load:
|
||||||
url:
|
|
||||||
interpolate_limit:
|
interpolate_limit:
|
||||||
time_shift_for_large_gaps:
|
time_shift_for_large_gaps:
|
||||||
manual_adjustments:
|
manual_adjustments:
|
||||||
@ -199,14 +198,13 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
config = snakemake.config
|
config = snakemake.config
|
||||||
powerstatistics = config['load']['power_statistics']
|
powerstatistics = config['load']['power_statistics']
|
||||||
url = config['load']['url']
|
|
||||||
interpolate_limit = config['load']['interpolate_limit']
|
interpolate_limit = config['load']['interpolate_limit']
|
||||||
countries = config['countries']
|
countries = config['countries']
|
||||||
snapshots = pd.date_range(freq='h', **config['snapshots'])
|
snapshots = pd.date_range(freq='h', **config['snapshots'])
|
||||||
years = slice(snapshots[0], snapshots[-1])
|
years = slice(snapshots[0], snapshots[-1])
|
||||||
time_shift = config['load']['time_shift_for_large_gaps']
|
time_shift = config['load']['time_shift_for_large_gaps']
|
||||||
|
|
||||||
load = load_timeseries(url, years, countries, powerstatistics)
|
load = load_timeseries(snakemake.input[0], years, countries, powerstatistics)
|
||||||
|
|
||||||
if config['load']['manual_adjustments']:
|
if config['load']['manual_adjustments']:
|
||||||
load = manual_adjustment(load, powerstatistics)
|
load = manual_adjustment(load, powerstatistics)
|
||||||
|
@ -149,7 +149,6 @@ transformers:
|
|||||||
type: ''
|
type: ''
|
||||||
|
|
||||||
load:
|
load:
|
||||||
url: https://data.open-power-system-data.org/time_series/2019-06-05/time_series_60min_singleindex.csv
|
|
||||||
power_statistics: True # only for files from <2019; set false in order to get ENTSOE transparency data
|
power_statistics: True # only for files from <2019; set false in order to get ENTSOE transparency data
|
||||||
interpolate_limit: 3 # data gaps up until this size are interpolated linearly
|
interpolate_limit: 3 # data gaps up until this size are interpolated linearly
|
||||||
time_shift_for_large_gaps: 1w # data gaps up until this size are copied by copying from
|
time_shift_for_large_gaps: 1w # data gaps up until this size are copied by copying from
|
||||||
|
Loading…
Reference in New Issue
Block a user