diff --git a/doc/configuration.rst b/doc/configuration.rst index ea8c81aa..17c8d9ac 100644 --- a/doc/configuration.rst +++ b/doc/configuration.rst @@ -9,7 +9,7 @@ Configuration ########################################## -PyPSA-Eur has several configuration options which are documented in this section and are collected in a ``config.yaml`` file located in the root directory. Users should copy the provided default configuration (``config.default.yaml``) and amend their own modifications and assumptions in the user-specific configuration file (``config.yaml``); confer installation instructions at :ref:`defaultconfig`. +PyPSA-Eur has several configuration options which are documented in this section and are collected in a ``config/config.yaml`` file located in the root directory. Users should copy the provided default configuration (``config/config.default.yaml``) and amend their own modifications and assumptions in the user-specific configuration file (``config/config.yaml``); confer installation instructions at :ref:`defaultconfig`. .. _toplevel_cf: diff --git a/doc/costs.rst b/doc/costs.rst index 46b93482..21938ced 100644 --- a/doc/costs.rst +++ b/doc/costs.rst @@ -9,7 +9,7 @@ Techno-Economic Assumptions The database of cost assumptions is retrieved from the repository `PyPSA/technology-data `_ and then -saved to a file ``data/costs_{year}.csv``. The ``config.yaml`` provides options +saved to a file ``data/costs_{year}.csv``. The ``config/config.yaml`` provides options to choose a reference year and use a specific version of the repository. .. literalinclude:: ../config.default.yaml @@ -48,7 +48,7 @@ Modifying Assumptions ===================== Some cost assumptions (e.g. marginal cost and capital cost) can be directly -set in the ``config.yaml`` (cf. Section :ref:`costs_cf` in +set in the ``config/config.yaml`` (cf. Section :ref:`costs_cf` in :ref:`config`). To change cost assumptions in more detail, make a copy of ``data/costs_{year}.csv`` and reference the new cost file in the ``Snakefile``: diff --git a/doc/foresight.rst b/doc/foresight.rst index f1ae2b38..9b821060 100644 --- a/doc/foresight.rst +++ b/doc/foresight.rst @@ -28,7 +28,7 @@ It does not affect the year for cost and technology assumptions, which is set se costs: year: 2030 -For running overnight scenarios, use in the ``config.yaml``: +For running overnight scenarios, use in the ``config/config.yaml``: .. code:: yaml @@ -44,7 +44,7 @@ Perfect foresight scenarios Perfect foresight is currently under development and not yet implemented. For running perfect foresight scenarios, in future versions you will be able to -set in the ``config.yaml``: +set in the ``config/config.yaml``: .. code:: yaml @@ -94,13 +94,13 @@ evolve with the myopic approach: Configuration -------------- -For running myopic foresight transition scenarios, set in ``config.yaml``: +For running myopic foresight transition scenarios, set in ``config/config.yaml``: .. code:: yaml foresight: myopic -The following options included in the config.yaml file are relevant for the +The following options included in the ``config/config.yaml`` file are relevant for the myopic code. The ``{planning_horizons}`` wildcard indicates the year in which the network is @@ -163,7 +163,7 @@ Options The total carbon budget for the entire transition path can be indicated in the `sector_opts `_ -in ``config.yaml``. The carbon budget can be split among the +in ``config/config.yaml``. The carbon budget can be split among the ``planning_horizons`` following an exponential or beta decay. E.g. ``'cb40ex0'`` splits a carbon budget equal to 40 Gt :math:`_{CO_2}` following an exponential decay whose initial linear growth rate r is zero. They can also follow some @@ -218,7 +218,7 @@ add_brownfield for the remaining planning_horizons. ``results/run_name/networks/prenetworks-brownfield``. Steps 2 and 3 are solved recursively for all the planning_horizons included in -``config.yaml``. +``config/config.yaml``. Rule overview -------------- diff --git a/doc/installation.rst b/doc/installation.rst index ed67f27d..b6fd574e 100644 --- a/doc/installation.rst +++ b/doc/installation.rst @@ -119,19 +119,19 @@ Handling Configuration Files ============================ PyPSA-Eur has several configuration options that must be specified in a -``config.yaml`` file located in the root directory. An example configuration -``config.default.yaml`` is maintained in the repository, which will be used to -automatically create your customisable ``config.yaml`` on first use. More +``config/config.yaml`` file located in the root directory. An example configuration +``config/config.default.yaml`` is maintained in the repository, which will be used to +automatically create your customisable ``config/config.yaml`` on first use. More details on the configuration options are in :ref:`config`. You can also use ``snakemake`` to specify another file, e.g. -``config.mymodifications.yaml``, to update the settings of the ``config.yaml``. +``config/config.mymodifications.yaml``, to update the settings of the ``config/config.yaml``. .. code:: bash - .../pypsa-eur % snakemake -call --configfile config.mymodifications.yaml + .../pypsa-eur % snakemake -call --configfile config/config.mymodifications.yaml .. warning:: - Users are advised to regularly check their own ``config.yaml`` against changes - in the ``config.default.yaml`` when pulling a new version from the remote + Users are advised to regularly check their own ``config/config.yaml`` against changes + in the ``config/config.default.yaml`` when pulling a new version from the remote repository. diff --git a/doc/introduction.rst b/doc/introduction.rst index 0ae038aa..df060723 100644 --- a/doc/introduction.rst +++ b/doc/introduction.rst @@ -74,7 +74,7 @@ what data to retrieve and what files to produce. Details are explained in :ref:`wildcards` and :ref:`scenario`. The model also has several further configuration options collected in the -``config.yaml`` file located in the root directory, which that are not part of +``config/config.yaml`` file located in the root directory, which that are not part of the scenarios. Options are explained in :ref:`config`. Folder Structure diff --git a/doc/release_notes.rst b/doc/release_notes.rst index 3d05f27c..d9fc5378 100644 --- a/doc/release_notes.rst +++ b/doc/release_notes.rst @@ -339,7 +339,7 @@ PyPSA-Eur 0.5.0 (27th July 2022) * Network building is made deterministic by supplying a fixed random state to network clustering routines. -* Clustering strategies for generator and bus attributes can now be specified directly in the ``config.yaml``. +* Clustering strategies for generator and bus attributes can now be specified directly in the ``config/config.yaml``. * Iterative solving with impedance updates is skipped if there are no expandable lines. diff --git a/doc/retrieve.rst b/doc/retrieve.rst index c06b330f..e4f47dec 100644 --- a/doc/retrieve.rst +++ b/doc/retrieve.rst @@ -42,7 +42,7 @@ The :ref:`tutorial` uses a smaller cutout than required for the full model (30 M build_cutout: .. seealso:: - Documentation of the configuration file ``config.yaml`` at + Documentation of the configuration file ``config/config.yaml`` at :ref:`toplevel_cf` **Outputs** @@ -69,7 +69,7 @@ This rule, as a substitute for :mod:`build_natura_raster`, downloads an already build_natura_raster: .. seealso:: - Documentation of the configuration file ``config.yaml`` at + Documentation of the configuration file ``config/config.yaml`` at :ref:`toplevel_cf` **Outputs** @@ -111,7 +111,7 @@ This rule downloads techno-economic assumptions from the `technology-data reposi version: .. seealso:: - Documentation of the configuration file ``config.yaml`` at + Documentation of the configuration file ``config/config.yaml`` at :ref:`costs_cf` **Outputs** diff --git a/doc/spatial_resolution.rst b/doc/spatial_resolution.rst index bbe5da05..0293a5ce 100644 --- a/doc/spatial_resolution.rst +++ b/doc/spatial_resolution.rst @@ -11,7 +11,7 @@ Spatial resolution The default nodal resolution of the model follows the electricity generation and transmission model `PyPSA-Eur `_, which clusters down the electricity transmission substations in each European country based on the k-means algorithm (See `cluster_network `_ for a complete explanation). This gives nodes which correspond to major load and generation centres (typically cities). -The total number of nodes for Europe is set in the ``config.yaml`` file under ``clusters``. The number of nodes can vary between 37, the number of independent countries / synchronous areas, and several hundred. With 200-300 nodes the model needs 100-150 GB RAM to solve with a commercial solver like Gurobi. +The total number of nodes for Europe is set in the ``config/config.yaml`` file under ``clusters``. The number of nodes can vary between 37, the number of independent countries / synchronous areas, and several hundred. With 200-300 nodes the model needs 100-150 GB RAM to solve with a commercial solver like Gurobi. Exemplary unsolved network clustered to 512 nodes: @@ -21,7 +21,7 @@ Exemplary unsolved network clustered to 37 nodes: .. image:: ../graphics/elec_s_37.png -The total number of nodes for Europe is set in the config.yaml file under `clusters `_. The number of nodes can vary between 37, the number of independent countries/synchronous areas, and several hundred. With 200-300 nodes, the model needs 100-150 GB RAM to solve with a commercial solver like Gurobi. +The total number of nodes for Europe is set in the ``config/config.yaml`` file under `clusters `_. The number of nodes can vary between 37, the number of independent countries/synchronous areas, and several hundred. With 200-300 nodes, the model needs 100-150 GB RAM to solve with a commercial solver like Gurobi. Not all of the sectors are at the full nodal resolution, and some demand for some sectors is distributed to nodes using heuristics that need to be corrected. Some networks are copper-plated to reduce computational times. Here are some examples of how spatial resolution is set for different sectors in PyPSA-Eur-Sec: diff --git a/doc/supply_demand.rst b/doc/supply_demand.rst index ed35bc38..16242405 100644 --- a/doc/supply_demand.rst +++ b/doc/supply_demand.rst @@ -189,7 +189,7 @@ higher costs and higher efficiency gains. They are added by step-wise linearisation in form of two additional generations in the `prepare_sector_network.py `_ script. -Settings in the config.yaml concerning the endogenously optimisation of building +Settings in the ``config/config.yaml`` concerning the endogenously optimisation of building renovation include `cost factor `_, `interest rate `_, `annualised cost `_, `tax weighting `_, and `construction index `_. Further information are given in the study by Zeyen et al. : `Mitigating heat demand peaks in buildings in a highly renewable European energy system, (2021) `_. diff --git a/doc/tutorial.rst b/doc/tutorial.rst index 82ccc55a..f396b82c 100644 --- a/doc/tutorial.rst +++ b/doc/tutorial.rst @@ -26,7 +26,7 @@ local machine. The tutorial will cover examples on how to configure and customise the PyPSA-Eur model and run the ``snakemake`` workflow step by step from network creation to the solved network. The configuration for the tutorial is located at ``test/config.electricity.yaml``. It includes parts deviating from -the default config file ``config.default.yaml``. To run the tutorial with this +the default config file ``config/config.default.yaml``. To run the tutorial with this configuration, execute .. code:: bash @@ -282,7 +282,7 @@ For example, you can explore the evolution of the PyPSA networks by running #. ``snakemake resources/networks/elec_s_6.nc -call --configfile test/config.electricity.yaml`` #. ``snakemake resources/networks/elec_s_6_ec_lcopt_Co2L-24H.nc -call --configfile test/config.electricity.yaml`` -To run all combinations of wildcard values provided in the ``config.yaml`` under ``scenario:``, +To run all combinations of wildcard values provided in the ``config/config.yaml`` under ``scenario:``, you can use the collection rule ``solve_elec_networks``. .. code:: bash @@ -290,7 +290,7 @@ you can use the collection rule ``solve_elec_networks``. snakemake -call solve_elec_networks --configfile test/config.electricity.yaml If you now feel confident and want to tackle runs with larger temporal and -spatial scope, clean-up the repository and after modifying the ``config.yaml`` file +spatial scope, clean-up the repository and after modifying the ``config/config.yaml`` file target the collection rule ``solve_elec_networks`` again without providing the test configuration file. diff --git a/doc/tutorial_sector.rst b/doc/tutorial_sector.rst index 1cbd6779..039271db 100644 --- a/doc/tutorial_sector.rst +++ b/doc/tutorial_sector.rst @@ -29,7 +29,7 @@ Overnight Scenarios Configuration ------------- -The default configuration file (``config.default.yaml``) is set up for running +The default configuration file (``config/config.default.yaml``) is set up for running overnight scenarios. Running a sector-coupled model unlocks many further configuration options. In the example below, we say that the gas network should be added and spatially resolved. We also say that the existing gas network may @@ -513,7 +513,7 @@ Scaling-Up ========== If you now feel confident and want to tackle runs with larger temporal, technological and -spatial scope, clean-up the repository and after modifying the ``config.yaml`` file +spatial scope, clean-up the repository and after modifying the ``config/config.yaml`` file target the collection rule ``all`` again without providing the test configuration file. diff --git a/scripts/_helpers.py b/scripts/_helpers.py index dc10eac1..a67fb105 100644 --- a/scripts/_helpers.py +++ b/scripts/_helpers.py @@ -83,7 +83,7 @@ def load_network(import_name=None, custom_components=None): custom_components : dict Dictionary listing custom components. For using ``snakemake.config['override_components']`` - in ``config.yaml`` define: + in ``config/config.yaml`` define: .. code:: yaml diff --git a/scripts/add_electricity.py b/scripts/add_electricity.py index ef6ff347..1d32bce1 100755 --- a/scripts/add_electricity.py +++ b/scripts/add_electricity.py @@ -41,7 +41,7 @@ Relevant Settings length_factor: .. seealso:: - Documentation of the configuration file ``config.yaml`` at :ref:`costs_cf`, + Documentation of the configuration file ``config/config.yaml`` at :ref:`costs_cf`, :ref:`electricity_cf`, :ref:`load_cf`, :ref:`renewable_cf`, :ref:`lines_cf` Inputs diff --git a/scripts/add_extra_components.py b/scripts/add_extra_components.py index b507148d..020370e5 100644 --- a/scripts/add_extra_components.py +++ b/scripts/add_extra_components.py @@ -27,7 +27,7 @@ Relevant Settings Store: .. seealso:: - Documentation of the configuration file ``config.yaml`` at :ref:`costs_cf`, + Documentation of the configuration file ``config/config.yaml`` at :ref:`costs_cf`, :ref:`electricity_cf` Inputs @@ -44,7 +44,7 @@ Outputs 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/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 - ``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/base_network.py b/scripts/base_network.py index 24097b1d..53b4dca3 100644 --- a/scripts/base_network.py +++ b/scripts/base_network.py @@ -38,7 +38,7 @@ Relevant Settings type: .. seealso:: - Documentation of the configuration file ``config.yaml`` at + Documentation of the configuration file ``config/config.yaml`` at :ref:`snapshots_cf`, :ref:`toplevel_cf`, :ref:`electricity_cf`, :ref:`load_cf`, :ref:`lines_cf`, :ref:`links_cf`, :ref:`transformers_cf` diff --git a/scripts/build_bus_regions.py b/scripts/build_bus_regions.py index cfbf90f7..ee90eef6 100644 --- a/scripts/build_bus_regions.py +++ b/scripts/build_bus_regions.py @@ -14,7 +14,7 @@ Relevant Settings countries: .. seealso:: - Documentation of the configuration file ``config.yaml`` at + Documentation of the configuration file ``config/config.yaml`` at :ref:`toplevel_cf` Inputs diff --git a/scripts/build_cutout.py b/scripts/build_cutout.py index eefa881b..365797d2 100644 --- a/scripts/build_cutout.py +++ b/scripts/build_cutout.py @@ -25,7 +25,7 @@ Relevant Settings {cutout}: .. seealso:: - Documentation of the configuration file ``config.yaml`` at + Documentation of the configuration file ``config/config.yaml`` at :ref:`atlite_cf` Inputs diff --git a/scripts/build_electricity_demand.py b/scripts/build_electricity_demand.py index 30f24f5c..b86b4a5f 100755 --- a/scripts/build_electricity_demand.py +++ b/scripts/build_electricity_demand.py @@ -25,7 +25,7 @@ Relevant Settings .. seealso:: - Documentation of the configuration file ``config.yaml`` at + Documentation of the configuration file ``config/config.yaml`` at :ref:`load_cf` Inputs diff --git a/scripts/build_hydro_profile.py b/scripts/build_hydro_profile.py index 9adf7112..0e8cfa27 100644 --- a/scripts/build_hydro_profile.py +++ b/scripts/build_hydro_profile.py @@ -20,7 +20,7 @@ Relevant Settings clip_min_inflow: .. seealso:: - Documentation of the configuration file ``config.yaml`` at + Documentation of the configuration file ``config/config.yaml`` at :ref:`toplevel_cf`, :ref:`renewable_cf` Inputs diff --git a/scripts/build_natura_raster.py b/scripts/build_natura_raster.py index 12011cd0..3cd62fd9 100644 --- a/scripts/build_natura_raster.py +++ b/scripts/build_natura_raster.py @@ -18,7 +18,7 @@ Relevant Settings cutout: .. seealso:: - Documentation of the configuration file ``config.yaml`` at + Documentation of the configuration file ``config/config.yaml`` at :ref:`renewable_cf` Inputs diff --git a/scripts/build_powerplants.py b/scripts/build_powerplants.py index a8a65249..9ca67a53 100755 --- a/scripts/build_powerplants.py +++ b/scripts/build_powerplants.py @@ -21,7 +21,7 @@ Relevant Settings custom_powerplants: .. seealso:: - Documentation of the configuration file ``config.yaml`` at + Documentation of the configuration file ``config/config.yaml`` at :ref:`electricity` Inputs diff --git a/scripts/build_renewable_profiles.py b/scripts/build_renewable_profiles.py index 6f03d746..c0288aee 100644 --- a/scripts/build_renewable_profiles.py +++ b/scripts/build_renewable_profiles.py @@ -42,7 +42,7 @@ Relevant settings resource: .. seealso:: - Documentation of the configuration file ``config.yaml`` at + Documentation of the configuration file ``config/config.yaml`` at :ref:`snapshots_cf`, :ref:`atlite_cf`, :ref:`renewable_cf` Inputs diff --git a/scripts/build_shapes.py b/scripts/build_shapes.py index fda7613f..50d21e12 100644 --- a/scripts/build_shapes.py +++ b/scripts/build_shapes.py @@ -15,7 +15,7 @@ Relevant Settings countries: .. seealso:: - Documentation of the configuration file ``config.yaml`` at + Documentation of the configuration file ``config/config.yaml`` at :ref:`toplevel_cf` Inputs diff --git a/scripts/build_ship_raster.py b/scripts/build_ship_raster.py index abfcdfa1..90e006b0 100644 --- a/scripts/build_ship_raster.py +++ b/scripts/build_ship_raster.py @@ -19,7 +19,7 @@ Relevant Settings cutout: .. seealso:: - Documentation of the configuration file ``config.yaml`` at + Documentation of the configuration file ``config/config.yaml`` at :ref:`renewable_cf` Inputs diff --git a/scripts/cluster_network.py b/scripts/cluster_network.py index e2cba28f..7572d3b3 100644 --- a/scripts/cluster_network.py +++ b/scripts/cluster_network.py @@ -27,7 +27,7 @@ Relevant Settings length_factor: .. seealso:: - Documentation of the configuration file ``config.yaml`` at + Documentation of the configuration file ``config/config.yaml`` at :ref:`toplevel_cf`, :ref:`renewable_cf`, :ref:`solving_cf`, :ref:`lines_cf` Inputs diff --git a/scripts/prepare_links_p_nom.py b/scripts/prepare_links_p_nom.py index 7941b69a..4b915d22 100644 --- a/scripts/prepare_links_p_nom.py +++ b/scripts/prepare_links_p_nom.py @@ -18,7 +18,7 @@ Relevant Settings prepare_links_p_nom: .. seealso:: - Documentation of the configuration file ``config.yaml`` at + Documentation of the configuration file ``config/config.yaml`` at :ref:`toplevel_cf` Inputs diff --git a/scripts/prepare_network.py b/scripts/prepare_network.py index 79b5c9d4..14a003ae 100755 --- a/scripts/prepare_network.py +++ b/scripts/prepare_network.py @@ -34,7 +34,7 @@ Relevant Settings max_hours: .. seealso:: - Documentation of the configuration file ``config.yaml`` at + Documentation of the configuration file ``config/config.yaml`` at :ref:`costs_cf`, :ref:`electricity_cf` Inputs diff --git a/scripts/retrieve_databundle.py b/scripts/retrieve_databundle.py index 52884328..0c6a7feb 100644 --- a/scripts/retrieve_databundle.py +++ b/scripts/retrieve_databundle.py @@ -23,7 +23,7 @@ The :ref:`tutorial` uses a smaller `data bundle