From ca0ad084381d3ffdda99433cfc4e9663fbc597f0 Mon Sep 17 00:00:00 2001 From: Fabian Neumann Date: Sun, 18 Oct 2020 14:47:46 +0200 Subject: [PATCH] reflect filename changes in documentation --- .travis.yml | 2 +- doc/cloudcomputing.rst | 2 +- doc/configuration.rst | 4 ++-- doc/release_notes.rst | 2 +- doc/solving.rst | 2 +- doc/tutorial.rst | 6 +++--- scripts/add_electricity.py | 4 ++-- scripts/add_extra_components.py | 4 ++-- scripts/build_country_flh.py | 4 ++-- scripts/build_renewable_profiles.py | 4 ++-- scripts/cluster_network.py | 16 ++++++++-------- scripts/prepare_network.py | 4 ++-- scripts/simplify_network.py | 8 ++++---- scripts/solve_network.py | 4 ++-- scripts/solve_operations_network.py | 6 +++--- 15 files changed, 36 insertions(+), 36 deletions(-) diff --git a/.travis.yml b/.travis.yml index a6a29a39..b7b8c4d9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,6 +31,6 @@ before_install: script: - cp ./test/config.test1.yaml ./config.yaml - - snakemake -j all solve_all_elec_networks + - snakemake -j all solve_all_networks - rm -rf resources/*.nc resources/*.geojson resources/*.h5 networks results # could repeat for more configurations in future diff --git a/doc/cloudcomputing.rst b/doc/cloudcomputing.rst index f91441a5..95bfa2c7 100644 --- a/doc/cloudcomputing.rst +++ b/doc/cloudcomputing.rst @@ -60,7 +60,7 @@ Now a window with the machine details will open. You have to configure the follo You can edit your machine configuration later. So use a cheap machine type configuration to transfer data and only when everything is ready and tested, your expensive machine type, for instance a custom 8 vCPU with 160 GB memory. Solvers do not parallelise well, so we recommend not to choose more than 8 vCPU. - Check ``snakemake -j -n 1 solve_all_elec_networks`` as a dry run to see how much memory is required. + Check ``snakemake -j -n 1 solve_all_networks`` as a dry run to see how much memory is required. The memory requirements will vary depending on the spatial and temporal resoulution of your optimisation. Example: for an hourly, 181 node full European network, set 8 vCPU and 150 GB memory since the dry-run calculated a 135 GB memory requirement.) - Boot disk: As default, your VM is created with 10 GB. Depending on how much you want to handle on one VM you should increase the disk size. diff --git a/doc/configuration.rst b/doc/configuration.rst index b065290b..95d7af31 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -40,9 +40,9 @@ facilitate running multiple scenarios through a single command .. code:: bash - snakemake -j 1 solve_all_elec_networks + snakemake -j 1 solve_all_networks -For each wildcard, a **list of values** is provided. The rule ``solve_all_elec_networks`` will trigger the rules for creating ``results/networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc`` for **all combinations** of the provided wildcard values as defined by Python's `itertools.product(...) `_ function that snakemake's `expand(...) function `_ uses. +For each wildcard, a **list of values** is provided. The rule ``solve_all_networks`` will trigger the rules for creating ``results/networks/elec{year}_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc`` for **all combinations** of the provided wildcard values as defined by Python's `itertools.product(...) `_ function that snakemake's `expand(...) function `_ uses. An exemplary dependency graph (starting from the simplification rules) then looks like this: diff --git a/doc/release_notes.rst b/doc/release_notes.rst index 9fc72206..5d2e0f05 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -124,7 +124,7 @@ Release Process * Upload code to `zenodo code repository `_ with `GNU GPL 3.0 `_ license. -* Create pre-built networks for ``config.default.yaml`` by running ``snakemake -j 1 extra_components_all_elec_networks``. +* Create pre-built networks for ``config.default.yaml`` by running ``snakemake -j 1 extra_components_all_networks``. * Upload pre-built networks to `zenodo data repository `_ with `CC BY 4.0 `_ license. diff --git a/doc/solving.rst b/doc/solving.rst index 2cc8eb57..87fdc040 100644 --- a/doc/solving.rst +++ b/doc/solving.rst @@ -7,7 +7,7 @@ Solving Networks ########################################## -After generating and simplifying the networks they can be solved through the rule :mod:`solve_network` by using the collection rule :mod:`solve_all_elec_networks`. Moreover, networks can be solved for another focus with the derivative rules :mod:`solve_network` by using the collection rule :mod:`solve_operations_network` for dispatch-only analyses on an already solved network. +After generating and simplifying the networks they can be solved through the rule :mod:`solve_network` by using the collection rule :mod:`solve_all_networks`. Moreover, networks can be solved for another focus with the derivative rules :mod:`solve_network` by using the collection rule :mod:`solve_operations_network` for dispatch-only analyses on an already solved network. .. toctree:: :caption: Overview diff --git a/doc/tutorial.rst b/doc/tutorial.rst index 3772bc43..53252ff8 100644 --- a/doc/tutorial.rst +++ b/doc/tutorial.rst @@ -119,8 +119,8 @@ orders ``snakemake`` to run the script ``solve_network`` that produces the solve .. code:: rule solve_network: - input: "networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc" - output: "results/networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc" + input: "networks/elec{year}_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc" + output: "results/networks/elec{year}_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc" [...] script: "scripts/solve_network.py" @@ -129,7 +129,7 @@ orders ``snakemake`` to run the script ``solve_network`` that produces the solve .. warning:: On Windows the previous command may currently cause a ``MissingRuleException`` due to problems with output files in subfolders. This is an `open issue `_ at `snakemake `_. - Windows users should add the option ``--keep-target-files`` to the command or instead run ``snakemake -j 1 solve_all_elec_networks``. + Windows users should add the option ``--keep-target-files`` to the command or instead run ``snakemake -j 1 solve_all_networks``. This triggers a workflow of multiple preceding jobs that depend on each rule's inputs and outputs: diff --git a/scripts/add_electricity.py b/scripts/add_electricity.py index a13cdb15..8ac455f7 100755 --- a/scripts/add_electricity.py +++ b/scripts/add_electricity.py @@ -524,8 +524,8 @@ if __name__ == "__main__": n = pypsa.Network(snakemake.input.base_network) - year = int(snakemake.wildcards.year) - snapshots = dict(start=str(year), end=str(year+1), closed="left") if year else snakememake.config['snapshots'] + year = snakemake.wildcards.year + snapshots = dict(start=year, end=str(int(year)+1), closed="left") if year else snakememake.config['snapshots'] n.set_snapshots(pd.date_range(freq='h', **snapshots)) n.snapshot_weightings[:] *= 8760. / n.snapshot_weightings.sum() Nyears = n.snapshot_weightings.sum() / 8760. diff --git a/scripts/add_extra_components.py b/scripts/add_extra_components.py index a7814ac6..c3af5c68 100644 --- a/scripts/add_extra_components.py +++ b/scripts/add_extra_components.py @@ -37,13 +37,13 @@ Inputs Outputs ------- -- ``networks/elec_s{simpl}_{clusters}_ec.nc``: +- ``networks/elec{year}_s{simpl}_{clusters}_ec.nc``: Description ----------- -The rule :mod:`add_extra_components` attaches additional extendable components to the clustered and simplified network. These can be configured in the ``config.yaml`` at ``electricity: extendable_carriers: ``. It processes ``networks/elec_s{simpl}_{clusters}.nc`` to build ``networks/elec_s{simpl}_{clusters}_ec.nc``, which in contrast to the former (depending on the configuration) contain with **zero** initial capacity +The rule :mod:`add_extra_components` attaches additional extendable components to the clustered and simplified network. These can be configured in the ``config.yaml`` at ``electricity: extendable_carriers: ``. It processes ``networks/elec{year}_s{simpl}_{clusters}.nc`` to build ``networks/elec{year}_s{simpl}_{clusters}_ec.nc``, which in contrast to the former (depending on the configuration) contain with **zero** initial capacity - ``StorageUnits`` of carrier 'H2' and/or 'battery'. If this option is chosen, every bus is given an extendable ``StorageUnit`` of the corresponding carrier. The energy and power capacities are linked through a parameter that specifies the energy capacity as maximum hours at full dispatch power and is configured in ``electricity: max_hours:``. This linkage leads to one investment variable per storage unit. The default ``max_hours`` lead to long-term hydrogen and short-term battery storage units. diff --git a/scripts/build_country_flh.py b/scripts/build_country_flh.py index 345d1d09..de78749c 100644 --- a/scripts/build_country_flh.py +++ b/scripts/build_country_flh.py @@ -165,8 +165,8 @@ if __name__ == '__main__': config = snakemake.config['renewable'][snakemake.wildcards.technology] - year = int(snakemake.wildcards.year) - snapshots = dict(start=str(year), end=str(year+1), closed="left") if year else snakememake.config['snapshots'] + year = snakemake.wildcards.year + snapshots = dict(start=year, end=str(int(year)+1), closed="left") if year else snakememake.config['snapshots'] time = pd.date_range(freq='m', **snapshots) params = dict(years=slice(*time.year[[0, -1]]), months=slice(*time.month[[0, -1]])) diff --git a/scripts/build_renewable_profiles.py b/scripts/build_renewable_profiles.py index 9b477625..a02d397b 100644 --- a/scripts/build_renewable_profiles.py +++ b/scripts/build_renewable_profiles.py @@ -284,8 +284,8 @@ if __name__ == '__main__': config = snakemake.config['renewable'][snakemake.wildcards.technology] - year = int(snakemake.wildcards.year) - snapshots = dict(start=str(year), end=str(year+1), closed="left") if year else snakememake.config['snapshots'] + year = snakemake.wildcards.year + snapshots = dict(start=year, end=str(int(year)+1), closed="left") if year else snakememake.config['snapshots'] time = pd.date_range(freq='m', **snapshots) params = dict(years=slice(*time.year[[0, -1]]), months=slice(*time.month[[0, -1]])) diff --git a/scripts/cluster_network.py b/scripts/cluster_network.py index 47da0b24..e48cb919 100644 --- a/scripts/cluster_network.py +++ b/scripts/cluster_network.py @@ -31,26 +31,26 @@ Relevant Settings Inputs ------ -- ``resources/regions_onshore_elec_s{simpl}.geojson``: confer :ref:`simplify` -- ``resources/regions_offshore_elec_s{simpl}.geojson``: confer :ref:`simplify` -- ``resources/clustermaps_elec_s{simpl}.h5``: confer :ref:`simplify` -- ``networks/elec_s{simpl}.nc``: confer :ref:`simplify` +- ``resources/regions_onshore_elec{year}_s{simpl}.geojson``: confer :ref:`simplify` +- ``resources/regions_offshore_elec{year}_s{simpl}.geojson``: confer :ref:`simplify` +- ``resources/clustermaps_elec{year}_s{simpl}.h5``: confer :ref:`simplify` +- ``networks/elec{year}_s{simpl}.nc``: confer :ref:`simplify` Outputs ------- -- ``resources/regions_onshore_elec_s{simpl}_{clusters}.geojson``: +- ``resources/regions_onshore_elec{year}_s{simpl}_{clusters}.geojson``: .. image:: ../img/regions_onshore_elec_s_X.png :scale: 33 % -- ``resources/regions_offshore_elec_s{simpl}_{clusters}.geojson``: +- ``resources/regions_offshore_elec{year}_s{simpl}_{clusters}.geojson``: .. image:: ../img/regions_offshore_elec_s_X.png :scale: 33 % -- ``resources/clustermaps_elec_s{simpl}_{clusters}.h5``: Mapping of buses and lines from ``networks/elec_s{simpl}.nc`` to ``networks/elec_s{simpl}_{clusters}.nc``; has keys ['/busmap', '/busmap_s', '/linemap', '/linemap_negative', '/linemap_positive'] -- ``networks/elec_s{simpl}_{clusters}.nc``: +- ``resources/clustermaps_elec{year}_s{simpl}_{clusters}.h5``: Mapping of buses and lines from ``networks/elec{year}_s{simpl}.nc`` to ``networks/elec{year}_s{simpl}_{clusters}.nc``; has keys ['/busmap', '/busmap_s', '/linemap', '/linemap_negative', '/linemap_positive'] +- ``networks/elec{year}_s{simpl}_{clusters}.nc``: .. image:: ../img/elec_s_X.png :scale: 40 % diff --git a/scripts/prepare_network.py b/scripts/prepare_network.py index a98c63fa..a93f8679 100755 --- a/scripts/prepare_network.py +++ b/scripts/prepare_network.py @@ -37,12 +37,12 @@ Inputs ------ - ``data/costs.csv``: The database of cost assumptions for all included technologies for specific years from various sources; e.g. discount rate, lifetime, investment (CAPEX), fixed operation and maintenance (FOM), variable operation and maintenance (VOM), fuel costs, efficiency, carbon-dioxide intensity. -- ``networks/elec_s{simpl}_{clusters}.nc``: confer :ref:`cluster` +- ``networks/elec{year}_s{simpl}_{clusters}.nc``: confer :ref:`cluster` Outputs ------- -- ``networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc``: Complete PyPSA network that will be handed to the ``solve_network`` rule. +- ``networks/elec{year}_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc``: Complete PyPSA network that will be handed to the ``solve_network`` rule. Description ----------- diff --git a/scripts/simplify_network.py b/scripts/simplify_network.py index eb6dbe6b..780a794d 100644 --- a/scripts/simplify_network.py +++ b/scripts/simplify_network.py @@ -52,18 +52,18 @@ Inputs Outputs ------- -- ``resources/regions_onshore_elec_s{simpl}.geojson``: +- ``resources/regions_onshore_elec{year}_s{simpl}.geojson``: .. image:: ../img/regions_onshore_elec_s.png :scale: 33 % -- ``resources/regions_offshore_elec_s{simpl}.geojson``: +- ``resources/regions_offshore_elec{year}_s{simpl}.geojson``: .. image:: ../img/regions_offshore_elec_s .png :scale: 33 % -- ``resources/clustermaps_elec_s{simpl}.h5``: Mapping of buses from ``networks/elec.nc`` to ``networks/elec_s{simpl}.nc``; has keys ['/busmap_s'] -- ``networks/elec_s{simpl}.nc``: +- ``resources/clustermaps_elec{year}_s{simpl}.h5``: Mapping of buses from ``networks/elec.nc`` to ``networks/elec{year}_s{simpl}.nc``; has keys ['/busmap_s'] +- ``networks/elec{year}_s{simpl}.nc``: .. image:: ../img/elec_s.png :scale: 33 % diff --git a/scripts/solve_network.py b/scripts/solve_network.py index e6936db6..6e733cd8 100755 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -40,12 +40,12 @@ Relevant Settings Inputs ------ -- ``networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc``: confer :ref:`prepare` +- ``networks/elec{year}_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc``: confer :ref:`prepare` Outputs ------- -- ``results/networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc``: Solved PyPSA network including optimisation results +- ``results/networks/elec{year}_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc``: Solved PyPSA network including optimisation results .. image:: ../img/results.png :scale: 40 % diff --git a/scripts/solve_operations_network.py b/scripts/solve_operations_network.py index c65e6889..7355bf40 100644 --- a/scripts/solve_operations_network.py +++ b/scripts/solve_operations_network.py @@ -32,13 +32,13 @@ Relevant Settings Inputs ------ -- ``networks/elec_s{simpl}_{clusters}.nc``: confer :ref:`cluster` -- ``results/networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc``: confer :ref:`solve` +- ``networks/elec{year}_s{simpl}_{clusters}.nc``: confer :ref:`cluster` +- ``results/networks/elec{year}_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc``: confer :ref:`solve` Outputs ------- -- ``results/networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}_op.nc``: Solved PyPSA network for optimal dispatch including optimisation results +- ``results/networks/elec{year}_s{simpl}_{clusters}_ec_l{ll}_{opts}_op.nc``: Solved PyPSA network for optimal dispatch including optimisation results Description -----------