diff --git a/Snakefile b/Snakefile index 4661eb5a..4d9c9a97 100644 --- a/Snakefile +++ b/Snakefile @@ -88,3 +88,12 @@ rule dag: dot -Tpdf -o {output.pdf} {output.dot} dot -Tpng -o {output.png} {output.dot} """ + + +rule doc: + message: + "Build documentation." + output: + directory("doc/_build") + shell: + "make -C doc html" diff --git a/doc/conf.py b/doc/conf.py index df787873..d9827a4b 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -136,7 +136,7 @@ html_theme = "sphinx_book_theme" html_theme_options = { "repository_url": "https://github.com/pypsa/pypsa-eur", "use_repository_button": True, - "show_navbar_depth": 2, + "show_navbar_depth": 1, } diff --git a/doc/index.rst b/doc/index.rst index c333a3a0..2249394a 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -159,8 +159,10 @@ Documentation **Rules Overview** +* :doc:`retrieve` * :doc:`preparation` * :doc:`simplification` +* :doc:`sector` * :doc:`solving` * :doc:`plotting` @@ -169,8 +171,10 @@ Documentation :maxdepth: 1 :caption: Rules Overview + retrieve preparation simplification + sector solving plotting diff --git a/doc/plotting.rst b/doc/plotting.rst index 88bacef1..f734b150 100644 --- a/doc/plotting.rst +++ b/doc/plotting.rst @@ -4,43 +4,13 @@ SPDX-License-Identifier: CC-BY-4.0 ########################################## -Plotting and Summary +Plotting and Summaries ########################################## -.. warning:: The corresponding code is currently under revision and has only minimal documentation. - Rule ``make_summary`` ======================== -.. graphviz:: - :align: center - - digraph snakemake_dag { - graph [bgcolor=white, - margin=0, - size="8,5" - ]; - node [fontname=sans, - fontsize=10, - penwidth=2, - shape=box, - style=rounded - ]; - edge [color=grey, - penwidth=2 - ]; - 0 [color="0.47 0.6 0.85", - fillcolor=gray, - label=make_summary, - style=filled]; - 1 [color="0.11 0.6 0.85", - label=solve_network]; - 1 -> 0; - } - -| - .. automodule:: make_summary .. _summary_plot: @@ -48,13 +18,6 @@ Rule ``make_summary`` Rule ``plot_summary`` ======================== -.. .. graphviz:: -.. :align: center - - - -| - .. automodule:: plot_summary .. _map_plot: @@ -62,35 +25,5 @@ Rule ``plot_summary`` Rule ``plot_network`` ======================== -.. graphviz:: - :align: center - - digraph snakemake_dag { - graph [bgcolor=white, - margin=0, - size="8,5" - ]; - node [fontname=sans, - fontsize=10, - penwidth=2, - shape=box, - style=rounded - ]; - edge [color=grey, - penwidth=2 - ]; - 0 [color="0.00 0.6 0.85", - fillcolor=gray, - label=plot_network, - style=filled]; - 1 [color="0.50 0.6 0.85", - label=solve_network]; - 1 -> 0; - } - -| - .. automodule:: plot_network -.. image:: img/tech-colors.png - :align: center diff --git a/doc/preparation.rst b/doc/preparation.rst index b15080e5..54897868 100644 --- a/doc/preparation.rst +++ b/doc/preparation.rst @@ -35,19 +35,92 @@ Then the process continues by calculating conventional power plant capacities, p The central rule :mod:`add_electricity` then ties all the different data inputs together into a detailed PyPSA network stored in ``networks/elec.nc``. -.. toctree:: - :caption: Overview +.. _busregions: - preparation/retrieve - preparation/build_shapes - preparation/build_load_data - preparation/build_cutout - preparation/build_natura_raster - preparation/build_ship_raster - preparation/prepare_links_p_nom - preparation/base_network - preparation/build_bus_regions - preparation/build_powerplants - preparation/build_renewable_profiles - preparation/build_hydro_profile - preparation/add_electricity +Rule ``build_bus_regions`` +============================= + +.. automodule:: build_bus_regions + +.. _cutout: + +Rule ``build_cutout`` +============================= + +.. automodule:: build_cutout + + +Rule ``prepare_links_p_nom`` +=============================== + +.. automodule:: prepare_links_p_nom + +.. _natura: + +Rule ``build_natura_raster`` +=============================== + +.. automodule:: build_natura_raster + + +.. _base: + +Rule ``base_network`` +============================= + +.. automodule:: base_network + +.. _shapes: + +Rule ``build_shapes`` +============================= + +.. automodule:: build_shapes + + +.. _powerplants: + +Rule ``build_powerplants`` +============================= + +.. automodule:: build_powerplants + + +.. _load_data: + +Rule ``build_load_data`` +============================= + + +.. automodule:: build_load_data + +.. _ship: + +Rule ``build_ship_raster`` +=============================== + + +.. automodule:: build_ship_raster + + +.. _renewableprofiles: + +Rule ``build_renewable_profiles`` +==================================== + +.. automodule:: build_renewable_profiles + + +.. _hydroprofiles: + +Rule ``build_hydro_profile`` +=============================== + +.. automodule:: build_hydro_profile + +.. _electricity: + +Rule ``add_electricity`` +============================= + +.. automodule:: add_electricity \ No newline at end of file diff --git a/doc/preparation/add_electricity.rst b/doc/preparation/add_electricity.rst deleted file mode 100644 index 6c42206b..00000000 --- a/doc/preparation/add_electricity.rst +++ /dev/null @@ -1,57 +0,0 @@ -.. - SPDX-FileCopyrightText: 2019-2023 The PyPSA-Eur Authors - - SPDX-License-Identifier: CC-BY-4.0 - -.. _electricity: - -Rule ``add_electricity`` -============================= - -.. graphviz:: - :align: center - - digraph snakemake_dag { - graph [bgcolor=white, - margin=0, - size="8,5" - ]; - node [fontname=sans, - fontsize=10, - penwidth=2, - shape=box, - style=rounded - ]; - edge [color=grey, - penwidth=2 - ]; - 3 [color="0.25 0.6 0.85", - label=simplify_network]; - 4 [color="0.50 0.6 0.85", - fillcolor=gray, - label=add_electricity, - style=filled]; - 4 -> 3; - 5 [color="0.36 0.6 0.85", - label=build_bus_regions]; - 5 -> 4; - 6 [color="0.58 0.6 0.85", - label=base_network]; - 6 -> 4; - 7 [color="0.31 0.6 0.85", - label=build_powerplants]; - 7 -> 4; - 8 [color="0.28 0.6 0.85", - label=build_shapes]; - 8 -> 4; - 9 [color="0.22 0.6 0.85", - label=build_renewable_profiles]; - 9 -> 4; - 10 [color="0.44 0.6 0.85", - label=build_hydro_profile]; - 10 -> 4; - } - -| - -.. automodule:: add_electricity diff --git a/doc/preparation/base_network.rst b/doc/preparation/base_network.rst deleted file mode 100644 index fd3afac3..00000000 --- a/doc/preparation/base_network.rst +++ /dev/null @@ -1,54 +0,0 @@ -.. - SPDX-FileCopyrightText: 2019-2023 The PyPSA-Eur Authors - - SPDX-License-Identifier: CC-BY-4.0 - -.. _base: - -Rule ``base_network`` -============================= - -.. graphviz:: - :align: center - - digraph snakemake_dag { - graph [bgcolor=white, - margin=0, - size="8,5" - ]; - node [fontname=sans, - fontsize=10, - penwidth=2, - shape=box, - style=rounded - ]; - edge [color=grey, - penwidth=2 - ]; - 4 [color="0.50 0.6 0.85", - label=add_electricity]; - 5 [color="0.36 0.6 0.85", - label=build_bus_regions]; - 6 [color="0.58 0.6 0.85", - fillcolor=gray, - label=base_network, - style=filled]; - 6 -> 4; - 6 -> 5; - 7 [color="0.31 0.6 0.85", - label=build_powerplants]; - 6 -> 7; - 9 [color="0.22 0.6 0.85", - label=build_renewable_profiles]; - 6 -> 9; - 8 [color="0.28 0.6 0.85", - label=build_shapes]; - 8 -> 6; - 11 [color="0.03 0.6 0.85", - label=prepare_links_p_nom]; - 11 -> 6; - } - -| - -.. automodule:: base_network diff --git a/doc/preparation/build_bus_regions.rst b/doc/preparation/build_bus_regions.rst deleted file mode 100644 index 70f2924f..00000000 --- a/doc/preparation/build_bus_regions.rst +++ /dev/null @@ -1,51 +0,0 @@ -.. - SPDX-FileCopyrightText: 2019-2023 The PyPSA-Eur Authors - - SPDX-License-Identifier: CC-BY-4.0 - -.. _busregions: - -Rule ``build_bus_regions`` -============================= - -.. graphviz:: - :align: center - - digraph snakemake_dag { - graph [bgcolor=white, - margin=0, - size="8,5" - ]; - node [fontname=sans, - fontsize=10, - penwidth=2, - shape=box, - style=rounded - ]; - edge [color=grey, - penwidth=2 - ]; - 3 [color="0.25 0.6 0.85", - label=simplify_network]; - 4 [color="0.50 0.6 0.85", - label=add_electricity]; - 5 [color="0.36 0.6 0.85", - fillcolor=gray, - label=build_bus_regions, - style=filled]; - 5 -> 3; - 5 -> 4; - 9 [color="0.22 0.6 0.85", - label=build_renewable_profiles]; - 5 -> 9; - 6 [color="0.58 0.6 0.85", - label=base_network]; - 6 -> 5; - 8 [color="0.28 0.6 0.85", - label=build_shapes]; - 8 -> 5; - } - -| - -.. automodule:: build_bus_regions diff --git a/doc/preparation/build_cutout.rst b/doc/preparation/build_cutout.rst deleted file mode 100644 index 0dc71d3a..00000000 --- a/doc/preparation/build_cutout.rst +++ /dev/null @@ -1,42 +0,0 @@ -.. - SPDX-FileCopyrightText: 2019-2023 The PyPSA-Eur Authors - - SPDX-License-Identifier: CC-BY-4.0 - -.. _cutout: - -Rule ``build_cutout`` -============================= - -.. graphviz:: - :align: center - - digraph snakemake_dag { - graph [bgcolor=white, - margin=0, - size="8,5" - ]; - node [fontname=sans, - fontsize=10, - penwidth=2, - shape=box, - style=rounded - ]; - edge [color=grey, - penwidth=2 - ]; - 9 [color="0.22 0.6 0.85", - label=build_renewable_profiles]; - 10 [color="0.44 0.6 0.85", - label=build_hydro_profile]; - 13 [color="0.17 0.6 0.85", - fillcolor=gray, - label=build_cutout, - style=filled]; - 13 -> 9; - 13 -> 10; - } - -| - -.. automodule:: build_cutout diff --git a/doc/preparation/build_hydro_profile.rst b/doc/preparation/build_hydro_profile.rst deleted file mode 100644 index 0217dbda..00000000 --- a/doc/preparation/build_hydro_profile.rst +++ /dev/null @@ -1,45 +0,0 @@ -.. - SPDX-FileCopyrightText: 2019-2023 The PyPSA-Eur Authors - - SPDX-License-Identifier: CC-BY-4.0 - -.. _hydroprofiles: - -Rule ``build_hydro_profile`` -=============================== - -.. graphviz:: - :align: center - - digraph snakemake_dag { - graph [bgcolor=white, - margin=0, - size="8,5" - ]; - node [fontname=sans, - fontsize=10, - penwidth=2, - shape=box, - style=rounded - ]; - edge [color=grey, - penwidth=2 - ]; - 4 [color="0.61 0.6 0.85", - label=add_electricity]; - 8 [color="0.00 0.6 0.85", - label=build_shapes]; - 10 [color="0.11 0.6 0.85", - fillcolor=gray, - label=build_hydro_profile, - style=filled]; - 8 -> 10; - 10 -> 4; - 13 [color="0.56 0.6 0.85", - label=build_cutout]; - 13 -> 10; - } - -| - -.. automodule:: build_hydro_profile diff --git a/doc/preparation/build_load_data.rst b/doc/preparation/build_load_data.rst deleted file mode 100644 index 723d71ac..00000000 --- a/doc/preparation/build_load_data.rst +++ /dev/null @@ -1,12 +0,0 @@ -.. - SPDX-FileCopyrightText: 2020-2023 The PyPSA-Eur Authors - - SPDX-License-Identifier: CC-BY-4.0 - -.. _load_data: - -Rule ``build_load_data`` -============================= - - -.. automodule:: build_load_data diff --git a/doc/preparation/build_natura_raster.rst b/doc/preparation/build_natura_raster.rst deleted file mode 100644 index e5744843..00000000 --- a/doc/preparation/build_natura_raster.rst +++ /dev/null @@ -1,39 +0,0 @@ -.. - SPDX-FileCopyrightText: 2019-2023 The PyPSA-Eur Authors - - SPDX-License-Identifier: CC-BY-4.0 - -.. _natura: - -Rule ``build_natura_raster`` -=============================== - -.. graphviz:: - :align: center - - digraph snakemake_dag { - graph [bgcolor=white, - margin=0, - size="8,5" - ]; - node [fontname=sans, - fontsize=10, - penwidth=2, - shape=box, - style=rounded - ]; - edge [color=grey, - penwidth=2 - ]; - 9 [color="0.22 0.6 0.85", - label=build_renewable_profiles]; - 12 [color="0.31 0.6 0.85", - fillcolor=gray, - label=build_natura_raster, - style=filled]; - 12 -> 9; - } - -| - -.. automodule:: build_natura_raster diff --git a/doc/preparation/build_powerplants.rst b/doc/preparation/build_powerplants.rst deleted file mode 100644 index 625d7d9b..00000000 --- a/doc/preparation/build_powerplants.rst +++ /dev/null @@ -1,42 +0,0 @@ -.. - SPDX-FileCopyrightText: 2019-2023 The PyPSA-Eur Authors - - SPDX-License-Identifier: CC-BY-4.0 - -.. _powerplants: - -Rule ``build_powerplants`` -============================= - -.. graphviz:: - :align: center - - digraph snakemake_dag { - graph [bgcolor=white, - margin=0, - size="8,5" - ]; - node [fontname=sans, - fontsize=10, - penwidth=2, - shape=box, - style=rounded - ]; - edge [color=grey, - penwidth=2 - ]; - 4 [color="0.61 0.6 0.85", - label=add_electricity]; - 6 [color="0.17 0.6 0.85", - label=base_network]; - 7 [color="0.58 0.6 0.85", - fillcolor=gray, - label=build_powerplants, - style=filled]; - 6 -> 7; - 7 -> 4; - } - -| - -.. automodule:: build_powerplants diff --git a/doc/preparation/build_renewable_profiles.rst b/doc/preparation/build_renewable_profiles.rst deleted file mode 100644 index 1d8a7e0b..00000000 --- a/doc/preparation/build_renewable_profiles.rst +++ /dev/null @@ -1,54 +0,0 @@ -.. - SPDX-FileCopyrightText: 2019-2023 The PyPSA-Eur Authors - - SPDX-License-Identifier: CC-BY-4.0 - -.. _renewableprofiles: - -Rule ``build_renewable_profiles`` -==================================== - -.. graphviz:: - :align: center - - digraph snakemake_dag { - graph [bgcolor=white, - margin=0, - size="8,5" - ]; - node [fontname=sans, - fontsize=10, - penwidth=2, - shape=box, - style=rounded - ]; - edge [color=grey, - penwidth=2 - ]; - 4 [color="0.61 0.6 0.85", - label=add_electricity]; - 5 [color="0.19 0.6 0.85", - label=build_bus_regions]; - 9 [color="0.22 0.6 0.85", - fillcolor=gray, - label=build_renewable_profiles, - style=filled]; - 5 -> 9; - 9 -> 4; - 6 [color="0.17 0.6 0.85", - label=base_network]; - 6 -> 9; - 8 [color="0.00 0.6 0.85", - label=build_shapes]; - 8 -> 9; - 12 [color="0.31 0.6 0.85", - label=build_natura_raster]; - 12 -> 9; - 13 [color="0.56 0.6 0.85", - label=build_cutout]; - 13 -> 9; - } - -| - -.. automodule:: build_renewable_profiles diff --git a/doc/preparation/build_shapes.rst b/doc/preparation/build_shapes.rst deleted file mode 100644 index ecbf2685..00000000 --- a/doc/preparation/build_shapes.rst +++ /dev/null @@ -1,51 +0,0 @@ -.. - SPDX-FileCopyrightText: 2019-2023 The PyPSA-Eur Authors - - SPDX-License-Identifier: CC-BY-4.0 - -.. _shapes: - -Rule ``build_shapes`` -============================= - -.. graphviz:: - :align: center - - digraph snakemake_dag { - graph [bgcolor=white, - margin=0, - size="8,5" - ]; - node [fontname=sans, - fontsize=10, - penwidth=2, - shape=box, - style=rounded - ]; - edge [color=grey, - penwidth=2 - ]; - 4 [color="0.61 0.6 0.85", - label=add_electricity]; - 5 [color="0.19 0.6 0.85", - label=build_bus_regions]; - 6 [color="0.17 0.6 0.85", - label=base_network]; - 8 [color="0.00 0.6 0.85", - fillcolor=gray, - label=build_shapes, - style=filled]; - 8 -> 4; - 8 -> 5; - 8 -> 6; - 9 [color="0.22 0.6 0.85", - label=build_renewable_profiles]; - 8 -> 9; - 10 [color="0.11 0.6 0.85", - label=build_hydro_profile]; - 8 -> 10; - } - -| - -.. automodule:: build_shapes diff --git a/doc/preparation/build_ship_raster.rst b/doc/preparation/build_ship_raster.rst deleted file mode 100644 index 5a38195e..00000000 --- a/doc/preparation/build_ship_raster.rst +++ /dev/null @@ -1,12 +0,0 @@ -.. - SPDX-FileCopyrightText: 2019-2023 The PyPSA-Eur Authors - - SPDX-License-Identifier: CC-BY-4.0 - -.. _ship: - -Rule ``build_ship_raster`` -=============================== - - -.. automodule:: build_ship_raster diff --git a/doc/preparation/prepare_links_p_nom.rst b/doc/preparation/prepare_links_p_nom.rst deleted file mode 100644 index 37690939..00000000 --- a/doc/preparation/prepare_links_p_nom.rst +++ /dev/null @@ -1,39 +0,0 @@ -.. - SPDX-FileCopyrightText: 2019-2023 The PyPSA-Eur Authors - - SPDX-License-Identifier: CC-BY-4.0 - -.. _links: - -Rule ``prepare_links_p_nom`` -=============================== - -.. graphviz:: - :align: center - - digraph snakemake_dag { - graph [bgcolor=white, - margin=0, - size="8,5" - ]; - node [fontname=sans, - fontsize=10, - penwidth=2, - shape=box, - style=rounded - ]; - edge [color=grey, - penwidth=2 - ]; - 6 [color="0.17 0.6 0.85", - label=base_network]; - 11 [color="0.39 0.6 0.85", - fillcolor=gray, - label=prepare_links_p_nom, - style=filled]; - 11 -> 6; - } - -| - -.. automodule:: prepare_links_p_nom diff --git a/doc/preparation/retrieve.rst b/doc/retrieve.rst similarity index 94% rename from doc/preparation/retrieve.rst rename to doc/retrieve.rst index 1a804dce..6975fc0a 100644 --- a/doc/preparation/retrieve.rst +++ b/doc/retrieve.rst @@ -5,8 +5,9 @@ .. _data: -Rules ``retrieve*`` -============================= +############### +Retrieving Data +############### Not all data dependencies are shipped with the git repository, since git is not suited for handling large changing files. @@ -14,12 +15,12 @@ Instead we provide separate data bundles which can be obtained using the ``retrieve*`` rules. Rule ``retrieve_databundle`` ----------------------------- +============================ .. automodule:: retrieve_databundle Rule ``retrieve_cutout`` ------------------------- +============================ .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.3517949.svg :target: https://doi.org/10.5281/zenodo.3517949 @@ -53,7 +54,7 @@ The :ref:`tutorial` uses a smaller cutout than required for the full model (30 M Rule ``retrieve_natura_raster`` -------------------------------- +================================ .. image:: https://zenodo.org/badge/DOI/10.5281/zenodo.4706686.svg :target: https://doi.org/10.5281/zenodo.4706686 @@ -80,7 +81,7 @@ This rule, as a substitute for :mod:`build_natura_raster`, downloads an already Rule ``retrieve_load_data`` ---------------------------- +================================ This rule downloads hourly electric load data for each country from the `OPSD platform `_. @@ -94,7 +95,7 @@ None. Rule ``retrieve_cost_data`` ---------------------------- +================================ This rule downloads techno-economic assumptions from the `technology-data repository `_. @@ -118,7 +119,7 @@ This rule downloads techno-economic assumptions from the `technology-data reposi - ``resources/costs.csv`` Rule ``retrieve_ship_raster`` ------------------------------ +================================ This rule downloads data on global shipping traffic density from the `World Bank Data Catalogue `_. @@ -132,7 +133,7 @@ None. Rule ``retrieve_sector_databundle`` ------------------------------------ +==================================== Small data files are included directly in the git repository, while diff --git a/doc/sector.rst b/doc/sector.rst new file mode 100644 index 00000000..5cc19063 --- /dev/null +++ b/doc/sector.rst @@ -0,0 +1,169 @@ +.. + SPDX-FileCopyrightText: 2023 The PyPSA-Eur Authors + + SPDX-License-Identifier: CC-BY-4.0 + +########################################## +Building Sector-Coupled Networks +########################################## + +Rule ``add_brownfield`` +============================================================================== + +.. automodule:: add_brownfield + +Rule ``add_existing_baseyear`` +============================================================================== + +.. automodule:: add_existing_baseyear + +Rule ``build_ammonia_production`` +============================================================================== + +.. automodule:: build_ammonia_production + +Rule ``build_biomass_potentials`` +============================================================================== + +.. automodule:: build_biomass_potentials + +Rule ``build_biomass_transport_costs`` +============================================================================== + +.. automodule:: build_biomass_transport_costs + +Rule ``build_clustered_population_layouts`` +============================================================================== + +.. automodule:: build_clustered_population_layouts + +Rule ``build_cop_profiles`` +============================================================================== + +.. automodule:: build_cop_profiles + +Rule ``build_energy_totals`` +============================================================================== + +.. automodule:: build_energy_totals + +Rule ``build_gas_input_locations`` +============================================================================== + +.. automodule:: build_gas_input_locations + +Rule ``build_gas_network`` +============================================================================== + +.. automodule:: build_gas_network + +Rule ``build_heat_demand`` +============================================================================== + +.. automodule:: build_heat_demand + +Rule ``build_industrial_distribution_key`` +============================================================================== + +.. automodule:: build_industrial_distribution_key + +Rule ``build_industrial_energy_demand_per_country_today`` +============================================================================== + +.. automodule:: build_industrial_energy_demand_per_country_today + +Rule ``build_industrial_energy_demand_per_node_today`` +============================================================================== + +.. automodule:: build_industrial_energy_demand_per_node_today + +Rule ``build_industrial_energy_demand_per_node`` +============================================================================== + +.. automodule:: build_industrial_energy_demand_per_node + +Rule ``build_industrial_production_per_country_tomorrow`` +============================================================================== + +.. automodule:: build_industrial_production_per_country_tomorrow + +Rule ``build_industrial_production_per_country`` +============================================================================== + +.. automodule:: build_industrial_production_per_country + +Rule ``build_industrial_production_per_node`` +============================================================================== + +.. automodule:: build_industrial_production_per_node + +Rule ``build_industry_sector_ratios`` +============================================================================== + +.. automodule:: build_industry_sector_ratios + +Rule ``build_population_layouts`` +============================================================================== + +.. automodule:: build_population_layouts + +Rule ``build_population_weighted_energy_totals`` +============================================================================== + +.. automodule:: build_population_weighted_energy_totals + +Rule ``build_retro_cost`` +============================================================================== + +.. automodule:: build_retro_cost + +Rule ``build_salt_cavern_potentials`` +============================================================================== + +.. automodule:: build_salt_cavern_potentials + +Rule ``build_sequestration_potentials`` +============================================================================== + +.. automodule:: build_sequestration_potentials + +Rule ``build_shipping_demand`` +============================================================================== + +.. automodule:: build_shipping_demand + +Rule ``build_solar_thermal_profiles`` +============================================================================== + +.. automodule:: build_solar_thermal_profiles + +Rule ``build_temperature_profiles`` +============================================================================== + +.. automodule:: build_temperature_profiles + +Rule ``build_transport_demand`` +============================================================================== + +.. automodule:: build_transport_demand + +Rule ``cluster_gas_network`` +============================================================================== + +.. automodule:: cluster_gas_network + +Rule ``copy_config`` +============================================================================== + +.. automodule:: copy_config + +Rule ``prepare_sector_network`` +============================================================================== + +.. automodule:: prepare_sector_network + + + + + + diff --git a/doc/simplification.rst b/doc/simplification.rst index aa6d2b0d..8fbbe7a5 100644 --- a/doc/simplification.rst +++ b/doc/simplification.rst @@ -20,10 +20,31 @@ The simplification and clustering steps are described in detail in the paper After simplification and clustering of the network, additional components may be appended in the rule :mod:`add_extra_components` and the network is prepared for solving in :mod:`prepare_network`. -.. toctree:: - :caption: Overview +.. _simplify: - simplification/simplify_network - simplification/cluster_network - simplification/add_extra_components - simplification/prepare_network +Rule ``simplify_network`` +============================ + +.. automodule:: simplify_network + +.. _cluster: + +Rule ``cluster_network`` +=========================== + +.. automodule:: cluster_network + +.. _extra_components: + +Rule ``add_extra_components`` +============================= + +.. automodule:: add_extra_components + + +.. _prepare: + +Rule ``prepare_network`` +=========================== + +.. automodule:: prepare_network diff --git a/doc/simplification/add_extra_components.rst b/doc/simplification/add_extra_components.rst deleted file mode 100644 index bf817afd..00000000 --- a/doc/simplification/add_extra_components.rst +++ /dev/null @@ -1,42 +0,0 @@ -.. - SPDX-FileCopyrightText: 2019-2023 The PyPSA-Eur Authors - - SPDX-License-Identifier: CC-BY-4.0 - -.. _extra_components: - -Rule ``add_extra_components`` -============================= - -.. graphviz:: - :align: center - - digraph snakemake_dag { - graph [bgcolor=white, - margin=0, - size="8,5" - ]; - node [fontname=sans, - fontsize=10, - penwidth=2, - shape=box, - style=rounded - ]; - edge [color=grey, - penwidth=2 - ]; - 1 [color="0.56 0.6 0.85", - label=prepare_network]; - 2 [color="0.47 0.6 0.85", - fillcolor=gray, - label=add_extra_components, - style=filled]; - 2 -> 1; - 3 [color="0.03 0.6 0.85", - label=cluster_network]; - 3 -> 2; - } - -| - -.. automodule:: add_extra_components diff --git a/doc/simplification/cluster_network.rst b/doc/simplification/cluster_network.rst deleted file mode 100644 index 5d5c041c..00000000 --- a/doc/simplification/cluster_network.rst +++ /dev/null @@ -1,43 +0,0 @@ -.. - SPDX-FileCopyrightText: 2019-2023 The PyPSA-Eur Authors - - SPDX-License-Identifier: CC-BY-4.0 - -.. _cluster: - -Rule ``cluster_network`` -=========================== - -.. graphviz:: - :align: center - - digraph snakemake_dag { - graph [bgcolor=white, - margin=0, - size="8,5" - ]; - node [fontname=sans, - fontsize=10, - penwidth=2, - shape=box, - style=rounded - ]; - edge [color=grey, - penwidth=2 - ]; - 1 [color="0.50 0.6 0.85", - label=prepare_network]; - 2 [color="0.36 0.6 0.85", - fillcolor=gray, - label=cluster_network, - style=filled]; - 2 -> 1; - 3 [color="0.14 0.6 0.85", - label=simplify_network]; - 3 -> 2; - } - - -| - -.. automodule:: cluster_network diff --git a/doc/simplification/prepare_network.rst b/doc/simplification/prepare_network.rst deleted file mode 100644 index 0668e972..00000000 --- a/doc/simplification/prepare_network.rst +++ /dev/null @@ -1,42 +0,0 @@ -.. - SPDX-FileCopyrightText: 2019-2023 The PyPSA-Eur Authors - - SPDX-License-Identifier: CC-BY-4.0 - -.. _prepare: - -Rule ``prepare_network`` -=========================== - -.. graphviz:: - :align: center - - digraph snakemake_dag { - graph [bgcolor=white, - margin=0, - size="8,5" - ]; - node [fontname=sans, - fontsize=10, - penwidth=2, - shape=box, - style=rounded - ]; - edge [color=grey, - penwidth=2 - ]; - 0 [color="0.53 0.6 0.85", - label=solve_network]; - 1 [color="0.50 0.6 0.85", - fillcolor=gray, - label=prepare_network, - style=filled]; - 1 -> 0; - 2 [color="0.36 0.6 0.85", - label=cluster_network]; - 2 -> 1; - } - -| - -.. automodule:: prepare_network diff --git a/doc/simplification/simplify_network.rst b/doc/simplification/simplify_network.rst deleted file mode 100644 index 452e5fe1..00000000 --- a/doc/simplification/simplify_network.rst +++ /dev/null @@ -1,45 +0,0 @@ -.. - SPDX-FileCopyrightText: 2019-2023 The PyPSA-Eur Authors - - SPDX-License-Identifier: CC-BY-4.0 - -.. _simplify: - -Rule ``simplify_network`` -============================ - -.. graphviz:: - :align: center - - digraph snakemake_dag { - graph [bgcolor=white, - margin=0, - size="8,5" - ]; - node [fontname=sans, - fontsize=10, - penwidth=2, - shape=box, - style=rounded - ]; - edge [color=grey, - penwidth=2 - ]; - 2 [color="0.36 0.6 0.85", - label=cluster_network]; - 3 [color="0.14 0.6 0.85", - fillcolor=gray, - label=simplify_network, - style=filled]; - 3 -> 2; - 4 [color="0.61 0.6 0.85", - label=add_electricity]; - 4 -> 3; - 5 [color="0.19 0.6 0.85", - label=build_bus_regions]; - 5 -> 3; - } - -| - -.. automodule:: simplify_network diff --git a/doc/solving.rst b/doc/solving.rst index 6f215904..bd38972b 100644 --- a/doc/solving.rst +++ b/doc/solving.rst @@ -9,8 +9,21 @@ 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_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 +.. _solve: - solving/solve_network - solving/solve_operations_network +Rule ``solve_network`` +========================= + +.. automodule:: solve_network + +.. _solve_operations: + +Rule ``solve_operations_network`` +==================================== + +.. automodule:: solve_operations_network + +Rule ``solve_sector_network`` +============================= + +.. automodule:: solve_sector_network \ No newline at end of file diff --git a/doc/solving/solve_network.rst b/doc/solving/solve_network.rst deleted file mode 100644 index afbc7634..00000000 --- a/doc/solving/solve_network.rst +++ /dev/null @@ -1,39 +0,0 @@ -.. - SPDX-FileCopyrightText: 2019-2023 The PyPSA-Eur Authors - - SPDX-License-Identifier: CC-BY-4.0 - -.. _solve: - -Rule ``solve_network`` -========================= - -.. graphviz:: - :align: center - - digraph snakemake_dag { - graph [bgcolor=white, - margin=0, - size="3,3" - ]; - node [fontname=sans, - fontsize=10, - penwidth=2, - shape=box, - style=rounded - ]; - edge [color=grey, - penwidth=2 - ]; - 0 [color="0.64 0.6 0.85", - fillcolor=gray, - label=solve_network, - style=filled]; - 1 [color="0.33 0.6 0.85", - label=prepare_network]; - 1 -> 0; - } - -| - -.. automodule:: solve_network diff --git a/doc/solving/solve_operations_network.rst b/doc/solving/solve_operations_network.rst deleted file mode 100644 index 67cb51ec..00000000 --- a/doc/solving/solve_operations_network.rst +++ /dev/null @@ -1,42 +0,0 @@ -.. - SPDX-FileCopyrightText: 2019-2023 The PyPSA-Eur Authors - - SPDX-License-Identifier: CC-BY-4.0 - -.. _solve_operations: - -Rule ``solve_operations_network`` -==================================== - -.. graphviz:: - :align: center - - digraph snakemake_dag { - graph [bgcolor=white, - margin=0, - size="8,5" - ]; - node [fontname=sans, - fontsize=10, - penwidth=2, - shape=box, - style=rounded - ]; - edge [color=grey, - penwidth=2 - ]; - 0 [color="0.06 0.6 0.85", - fillcolor=gray, - label=solve_operations_network, - style=filled]; - 1 [color="0.00 0.6 0.85", - label=cluster_network]; - 1 -> 0; - 2 [color="0.19 0.6 0.85", - label=solve_network]; - 2 -> 0; - } - -| - -.. automodule:: solve_operations_network diff --git a/doc/supply_demand.rst b/doc/supply_demand.rst index 85192d42..ed35bc38 100644 --- a/doc/supply_demand.rst +++ b/doc/supply_demand.rst @@ -322,14 +322,16 @@ The model can only use biogas by first upgrading it to natural gas quality [see Oil-based products demand -======================== +========================= + Naphtha is used as a feedstock in the chemicals industry (see :ref:`Chemicals Industry`). Furthermore, kerosene is used as transport fuel in the aviation sector (see :ref:`Aviation`). Non-electrified agriculture machinery also consumes gasoline. Land transport [(see :ref:`Land transport`) that is not electrified or converted into using :math:`H_2`-fuel cells also consumes oil-based products. While there is regional distribution of demand, the carrier is copperplated in the model, which means that transport costs and constraints are neglected. .. _Oil-based products supply: Oil-based products supply -======================== +========================= + Oil-based products can be either of fossil origin or synthetically produced by combining :math:`H_2` (see :ref:`Hydrogen supply`) and captured :math:`CO_2` (see :ref:`Carbon dioxide capture, usage and sequestration (CCU/S)`) in Fischer-Tropsch plants .. math:: diff --git a/scripts/add_electricity.py b/scripts/add_electricity.py index 006c8586..ef6ff347 100755 --- a/scripts/add_electricity.py +++ b/scripts/add_electricity.py @@ -50,7 +50,7 @@ Inputs - ``resources/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. - ``data/bundle/hydro_capacities.csv``: Hydropower plant store/discharge power capacities, energy storage capacity, and average hourly inflow by country. - .. image:: ../img/hydrocapacities.png + .. image:: img/hydrocapacities.png :scale: 34 % - ``data/geth2015_hydro_capacities.csv``: alternative to capacities above; not currently used! @@ -66,7 +66,7 @@ Outputs - ``networks/elec.nc``: - .. image:: ../img/elec.png + .. image:: img/elec.png :scale: 33 % Description diff --git a/scripts/base_network.py b/scripts/base_network.py index 609b2818..24097b1d 100644 --- a/scripts/base_network.py +++ b/scripts/base_network.py @@ -58,7 +58,7 @@ Outputs - ``networks/base.nc`` - .. image:: ../img/base.png + .. image:: img/base.png :scale: 33 % Description diff --git a/scripts/build_bus_regions.py b/scripts/build_bus_regions.py index bc9826fb..f1a0558a 100644 --- a/scripts/build_bus_regions.py +++ b/scripts/build_bus_regions.py @@ -30,12 +30,12 @@ Outputs - ``resources/regions_onshore.geojson``: - .. image:: ../img/regions_onshore.png + .. image:: img/regions_onshore.png :scale: 33 % - ``resources/regions_offshore.geojson``: - .. image:: ../img/regions_offshore.png + .. image:: img/regions_offshore.png :scale: 33 % Description diff --git a/scripts/build_cutout.py b/scripts/build_cutout.py index 9df4e6de..fd148cac 100644 --- a/scripts/build_cutout.py +++ b/scripts/build_cutout.py @@ -78,13 +78,13 @@ Outputs wnd100m time, y, x ms**-1 Wind speeds at 100 meters (regardless of direction) =================== ========== ========== ========================================================= - .. image:: ../img/era5.png + .. image:: img/era5.png :scale: 40 % A **SARAH-2 cutout** can be used to amend the fields ``temperature``, ``influx_toa``, ``influx_direct``, ``albedo``, ``influx_diffuse`` of ERA5 using satellite-based radiation observations. - .. image:: ../img/sarah.png + .. image:: img/sarah.png :scale: 40 % Description diff --git a/scripts/build_hydro_profile.py b/scripts/build_hydro_profile.py index 3e36a1b9..279bd7a1 100644 --- a/scripts/build_hydro_profile.py +++ b/scripts/build_hydro_profile.py @@ -29,7 +29,7 @@ Inputs - ``data/bundle/EIA_hydro_generation_2000_2014.csv``: Hydroelectricity net generation per country and year (`EIA `_) - .. image:: ../img/hydrogeneration.png + .. image:: img/hydrogeneration.png :scale: 33 % - ``resources/country_shapes.geojson``: confer :ref:`shapes` @@ -47,10 +47,10 @@ Outputs e.g. due to river inflow in hydro reservoir. =================== ================ ========================================================= - .. image:: ../img/inflow-ts.png + .. image:: img/inflow-ts.png :scale: 33 % - .. image:: ../img/inflow-box.png + .. image:: img/inflow-box.png :scale: 33 % Description diff --git a/scripts/build_natura_raster.py b/scripts/build_natura_raster.py index 8a20e859..9246508e 100644 --- a/scripts/build_natura_raster.py +++ b/scripts/build_natura_raster.py @@ -27,7 +27,7 @@ Inputs - ``data/bundle/natura/Natura2000_end2015.shp``: `Natura 2000 `_ natural protection areas. - .. image:: ../img/natura.png + .. image:: img/natura.png :scale: 33 % Outputs @@ -35,7 +35,7 @@ Outputs - ``resources/natura.tiff``: Rasterized version of `Natura 2000 `_ natural protection areas to reduce computation times. - .. image:: ../img/natura.png + .. image:: img/natura.png :scale: 33 % Description diff --git a/scripts/build_powerplants.py b/scripts/build_powerplants.py index f15a9082..a8a65249 100755 --- a/scripts/build_powerplants.py +++ b/scripts/build_powerplants.py @@ -35,7 +35,7 @@ Outputs - ``resource/powerplants.csv``: A list of conventional power plants (i.e. neither wind nor solar) with fields for name, fuel type, technology, country, capacity in MW, duration, commissioning year, retrofit year, latitude, longitude, and dam information as documented in the `powerplantmatching README `_; additionally it includes information on the closest substation/bus in ``networks/base.nc``. - .. image:: ../img/powerplantmatching.png + .. image:: img/powerplantmatching.png :scale: 30 % **Source:** `powerplantmatching on GitHub `_ diff --git a/scripts/build_renewable_profiles.py b/scripts/build_renewable_profiles.py index c6e4271c..ea4dfa9a 100644 --- a/scripts/build_renewable_profiles.py +++ b/scripts/build_renewable_profiles.py @@ -51,12 +51,12 @@ Inputs - ``data/bundle/corine/g250_clc06_V18_5.tif``: `CORINE Land Cover (CLC) `_ inventory on `44 classes `_ of land use (e.g. forests, arable land, industrial, urban areas). - .. image:: ../img/corine.png + .. image:: img/corine.png :scale: 33 % - ``data/bundle/GEBCO_2014_2D.nc``: A `bathymetric `_ data set with a global terrain model for ocean and land at 15 arc-second intervals by the `General Bathymetric Chart of the Oceans (GEBCO) `_. - .. image:: ../img/gebco_2019_grid_image.jpg + .. image:: img/gebco_2019_grid_image.jpg :scale: 50 % **Source:** `GEBCO `_ @@ -95,31 +95,31 @@ Outputs - **profile** - .. image:: ../img/profile_ts.png + .. image:: img/profile_ts.png :scale: 33 % :align: center - **p_nom_max** - .. image:: ../img/p_nom_max_hist.png + .. image:: img/p_nom_max_hist.png :scale: 33 % :align: center - **potential** - .. image:: ../img/potential_heatmap.png + .. image:: img/potential_heatmap.png :scale: 33 % :align: center - **average_distance** - .. image:: ../img/distance_hist.png + .. image:: img/distance_hist.png :scale: 33 % :align: center - **underwater_fraction** - .. image:: ../img/underwater_hist.png + .. image:: img/underwater_hist.png :scale: 33 % :align: center @@ -140,7 +140,7 @@ cutout grid cell and each node using the `GLAES `_ library. This uses the CORINE land use data, Natura2000 nature reserves and GEBCO bathymetry data. -.. image:: ../img/eligibility.png +.. image:: img/eligibility.png :scale: 50 % :align: center @@ -149,19 +149,19 @@ installable potential in each grid cell is multiplied with the capacity factor at each grid cell. This is done since we assume more generators are installed at cells with a higher capacity factor. -.. image:: ../img/offwinddc-gridcell.png +.. image:: img/offwinddc-gridcell.png :scale: 50 % :align: center -.. image:: ../img/offwindac-gridcell.png +.. image:: img/offwindac-gridcell.png :scale: 50 % :align: center -.. image:: ../img/onwind-gridcell.png +.. image:: img/onwind-gridcell.png :scale: 50 % :align: center -.. image:: ../img/solar-gridcell.png +.. image:: img/solar-gridcell.png :scale: 50 % :align: center diff --git a/scripts/build_retro_cost.py b/scripts/build_retro_cost.py index 88f85517..0eeba4fd 100644 --- a/scripts/build_retro_cost.py +++ b/scripts/build_retro_cost.py @@ -60,13 +60,13 @@ Structure The script has the following structure: - (i) fixed parameters are set - (ii) functions + (0) fixed parameters are set (1) prepare data, bring to same format (2) calculate space heat demand depending on additional insulation material (3) calculate costs for corresponding additional insulation material (4) get cost savings per retrofitting measures for each sector by weighting with heated floor area + """ import pandas as pd import xarray as xr diff --git a/scripts/build_shapes.py b/scripts/build_shapes.py index 3daed847..699b9818 100644 --- a/scripts/build_shapes.py +++ b/scripts/build_shapes.py @@ -4,9 +4,8 @@ # SPDX-License-Identifier: MIT """ -Creates GIS shape files of the countries, exclusive economic zones and `NUTS3 < -https://en.wikipedia.org/wiki/Nomenclature_of_Territorial_Units_for_Statistics> -`_ areas. +Creates GIS shape files of the countries, exclusive economic zones and +`NUTS3 `_ areas. Relevant Settings ----------------- @@ -24,17 +23,17 @@ Inputs - ``data/bundle/naturalearth/ne_10m_admin_0_countries.shp``: World country shapes - .. image:: ../img/countries.png + .. image:: img/countries.png :scale: 33 % - ``data/bundle/eez/World_EEZ_v8_2014.shp``: World `exclusive economic zones `_ (EEZ) - .. image:: ../img/eez.png + .. image:: img/eez.png :scale: 33 % - ``data/bundle/NUTS_2013_60M_SH/data/NUTS_RG_60M_2013.shp``: Europe NUTS3 regions - .. image:: ../img/nuts3.png + .. image:: img/nuts3.png :scale: 33 % - ``data/bundle/nama_10r_3popgdp.tsv.gz``: Average annual population by NUTS3 region (`eurostat `__) @@ -47,22 +46,22 @@ Outputs - ``resources/country_shapes.geojson``: country shapes out of country selection - .. image:: ../img/country_shapes.png + .. image:: img/country_shapes.png :scale: 33 % - ``resources/offshore_shapes.geojson``: EEZ shapes out of country selection - .. image:: ../img/offshore_shapes.png + .. image:: img/offshore_shapes.png :scale: 33 % - ``resources/europe_shape.geojson``: Shape of Europe including countries and EEZ - .. image:: ../img/europe_shape.png + .. image:: img/europe_shape.png :scale: 33 % - ``resources/nuts3_shapes.geojson``: NUTS3 shapes out of country selection including population and GDP data. - .. image:: ../img/nuts3_shapes.png + .. image:: img/nuts3_shapes.png :scale: 33 % Description diff --git a/scripts/cluster_network.py b/scripts/cluster_network.py index 876b8209..c206ae01 100644 --- a/scripts/cluster_network.py +++ b/scripts/cluster_network.py @@ -44,19 +44,19 @@ Outputs - ``resources/regions_onshore_elec_s{simpl}_{clusters}.geojson``: - .. image:: ../img/regions_onshore_elec_s_X.png + .. image:: img/regions_onshore_elec_s_X.png :scale: 33 % - ``resources/regions_offshore_elec_s{simpl}_{clusters}.geojson``: - .. image:: ../img/regions_offshore_elec_s_X.png + .. image:: img/regions_offshore_elec_s_X.png :scale: 33 % - ``resources/busmap_elec_s{simpl}_{clusters}.csv``: Mapping of buses from ``networks/elec_s{simpl}.nc`` to ``networks/elec_s{simpl}_{clusters}.nc``; - ``resources/linemap_elec_s{simpl}_{clusters}.csv``: Mapping of lines from ``networks/elec_s{simpl}.nc`` to ``networks/elec_s{simpl}_{clusters}.nc``; - ``networks/elec_s{simpl}_{clusters}.nc``: - .. image:: ../img/elec_s_X.png + .. image:: img/elec_s_X.png :scale: 40 % Description @@ -99,25 +99,25 @@ Description Exemplary unsolved network clustered to 512 nodes: -.. image:: ../img/elec_s_512.png +.. image:: img/elec_s_512.png :scale: 40 % :align: center Exemplary unsolved network clustered to 256 nodes: -.. image:: ../img/elec_s_256.png +.. image:: img/elec_s_256.png :scale: 40 % :align: center Exemplary unsolved network clustered to 128 nodes: -.. image:: ../img/elec_s_128.png +.. image:: img/elec_s_128.png :scale: 40 % :align: center Exemplary unsolved network clustered to 37 nodes: -.. image:: ../img/elec_s_37.png +.. image:: img/elec_s_37.png :scale: 40 % :align: center """ diff --git a/scripts/simplify_network.py b/scripts/simplify_network.py index ded6e9e7..5e50c4ab 100644 --- a/scripts/simplify_network.py +++ b/scripts/simplify_network.py @@ -57,18 +57,18 @@ Outputs - ``resources/regions_onshore_elec_s{simpl}.geojson``: - .. image:: ../img/regions_onshore_elec_s.png + .. image:: img/regions_onshore_elec_s.png :scale: 33 % - ``resources/regions_offshore_elec_s{simpl}.geojson``: - .. image:: ../img/regions_offshore_elec_s .png + .. image:: img/regions_offshore_elec_s .png :scale: 33 % - ``resources/busmap_elec_s{simpl}.csv``: Mapping of buses from ``networks/elec.nc`` to ``networks/elec_s{simpl}.nc``; - ``networks/elec_s{simpl}.nc``: - .. image:: ../img/elec_s.png + .. image:: img/elec_s.png :scale: 33 % Description diff --git a/scripts/solve_network.py b/scripts/solve_network.py index 24269cb2..51891275 100755 --- a/scripts/solve_network.py +++ b/scripts/solve_network.py @@ -41,7 +41,7 @@ Outputs - ``results/networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc``: Solved PyPSA network including optimisation results - .. image:: ../img/results.png + .. image:: img/results.png :scale: 40 % Description