From 879d2925f9fbda2663e8715c7fd8e44154f81d4a Mon Sep 17 00:00:00 2001 From: Fabian Date: Mon, 3 Jul 2023 17:14:50 +0200 Subject: [PATCH] rename "ept" to "Ept" restructure remote rsync with remote --- .sync-send | 11 +++++++++++ .syncignore-receive | 21 --------------------- .syncignore-send | 23 ----------------------- Snakefile | 12 ++++++++++++ config/config.default.yaml | 4 ++++ config/config.validation.yaml | 8 +------- scripts/prepare_network.py | 6 +++--- 7 files changed, 31 insertions(+), 54 deletions(-) create mode 100644 .sync-send delete mode 100644 .syncignore-receive delete mode 100644 .syncignore-send diff --git a/.sync-send b/.sync-send new file mode 100644 index 00000000..72252956 --- /dev/null +++ b/.sync-send @@ -0,0 +1,11 @@ +# SPDX-FileCopyrightText: : 2021-2023 The PyPSA-Eur Authors +# +# SPDX-License-Identifier: CC0-1.0 + +rules +scripts +config +config/test +envs +matplotlibrc +Snakefile diff --git a/.syncignore-receive b/.syncignore-receive deleted file mode 100644 index d2e9b76d..00000000 --- a/.syncignore-receive +++ /dev/null @@ -1,21 +0,0 @@ -# SPDX-FileCopyrightText: : 2021-2023 The PyPSA-Eur Authors -# -# SPDX-License-Identifier: CC0-1.0 - -.snakemake -.git -.pytest_cache -.ipynb_checkpoints -.vscode -.DS_Store -__pycache__ -*.pyc -*.pyo -*.ipynb -notebooks -doc -cutouts -data -benchmarks -*.nc -configs diff --git a/.syncignore-send b/.syncignore-send deleted file mode 100644 index 4e6e9a8c..00000000 --- a/.syncignore-send +++ /dev/null @@ -1,23 +0,0 @@ -# SPDX-FileCopyrightText: : 2021-2023 The PyPSA-Eur Authors -# -# SPDX-License-Identifier: CC0-1.0 - -.snakemake -.git -.pytest_cache -.ipynb_checkpoints -.vscode -.DS_Store -__pycache__ -*.pyc -*.pyo -*.ipynb -notebooks -benchmarks -logs -resources* -results -networks* -cutouts -data/bundle -doc diff --git a/Snakefile b/Snakefile index eb5c03e9..fa3c606c 100644 --- a/Snakefile +++ b/Snakefile @@ -53,6 +53,7 @@ include: "rules/build_electricity.smk" include: "rules/build_sector.smk" include: "rules/solve_electricity.smk" include: "rules/postprocess.smk" +include: "rules/validate.smk" if config["foresight"] == "overnight": @@ -98,3 +99,14 @@ rule doc: directory("doc/_build"), shell: "make -C doc html" + + +rule sync: + params: + cluster=f"{config['remote']['ssh']}:{config['remote']['path']}", + shell: + """ + rsync -uvarh --no-g --ignore-missing-args --files-from=.sync-send . {params.cluster} + rsync -uvarh --no-g --ignore-missing-args {params.cluster}/results results + rsync -uvarh --no-g --ignore-missing-args {params.cluster}/logs logs + """ diff --git a/config/config.default.yaml b/config/config.default.yaml index 93cc9405..379fd35e 100644 --- a/config/config.default.yaml +++ b/config/config.default.yaml @@ -9,6 +9,10 @@ logging: level: INFO format: '%(levelname)s:%(name)s:%(message)s' +remote: + ssh: "" + path: "" + run: name: "" # use this to keep track of runs with different settings disable_progressbar: false # set to true to disable the progressbar diff --git a/config/config.validation.yaml b/config/config.validation.yaml index 6533d0fe..79c5dd00 100644 --- a/config/config.validation.yaml +++ b/config/config.validation.yaml @@ -11,7 +11,7 @@ scenario: clusters: # number of nodes in Europe, any integer between 37 (1 node per country-zone) and several hundred - 37c opts: # only relevant for PyPSA-Eur - - 'ept' + - 'Ept' sector_opts: # this is where the main scenario settings are - Co2L0-1H-T-H-B-I-A-solar+p3-dist1 @@ -84,12 +84,6 @@ costs: emission_prices: # in currency per tonne emission, only used with the option Ep co2: 25 -clustering: - simplify_network: - exclude_carriers: ['CCGT', 'lignite', 'oil', 'coal', 'OCGT', 'nuclear'] - cluster_network: - exclude_carriers: ['CCGT', 'lignite', 'oil', 'coal', 'OCGT', 'nuclear'] - solving: #tmpdir: "path/to/tmp" options: diff --git a/scripts/prepare_network.py b/scripts/prepare_network.py index 8d4eff1f..affcac7e 100755 --- a/scripts/prepare_network.py +++ b/scripts/prepare_network.py @@ -108,7 +108,7 @@ def add_emission_prices(n, emission_prices={"co2": 0.0}, exclude_co2=False): n.storage_units["marginal_cost"] += su_ep -def add_emission_prices_t(n): +def add_dynamic_emission_prices(n): co2_price = pd.read_csv(snakemake.input.co2_price, index_col=0, parse_dates=True) co2_price = co2_price[~co2_price.index.duplicated()] co2_price = ( @@ -341,11 +341,11 @@ if __name__ == "__main__": logger.info("Setting emission prices according to config value.") add_emission_prices(n, snakemake.params.costs["emission_prices"]) break - if "ept" in o: + if "Ept" in o: logger.info( "Setting time dependent emission prices according spot market price" ) - add_emission_prices_t(n) + add_dynamic_emission_prices(n) ll_type, factor = snakemake.wildcards.ll[0], snakemake.wildcards.ll[1:] set_transmission_limit(n, ll_type, factor, costs, Nyears)