add rulegraphs

This commit is contained in:
Fabian Neumann 2019-08-14 17:15:07 +02:00
parent 0e5886081e
commit 03b51cac18
21 changed files with 694 additions and 17 deletions

View File

@ -36,6 +36,7 @@ extensions = [
'sphinx.ext.todo', 'sphinx.ext.todo',
'sphinx.ext.mathjax', 'sphinx.ext.mathjax',
'sphinx.ext.napoleon', 'sphinx.ext.napoleon',
'sphinx.ext.graphviz',
#'sphinx.ext.pngmath', #'sphinx.ext.pngmath',
#'sphinxcontrib.tikz', #'sphinxcontrib.tikz',
#'rinoh.frontend.sphinx', #'rinoh.frontend.sphinx',

View File

@ -4,31 +4,166 @@ Plotting and Summary
.. warning:: The corresponding code is currently under revision and has only minimal documentation. .. warning:: The corresponding code is currently under revision and has only minimal documentation.
.. _flh:
Rule :mod:`build_country_flh`
=============================
.. 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.31 0.6 0.85",
fillcolor=gray,
label=build_country_flh,
style=filled];
1 [color="0.06 0.6 0.85",
label=base_network];
1 -> 0;
2 [color="0.42 0.6 0.85",
label=build_natura_raster];
2 -> 0;
3 [color="0.58 0.6 0.85",
label=build_shapes];
3 -> 0;
4 [color="0.14 0.6 0.85",
label=build_cutout];
4 -> 0;
}
|
.. automodule:: build_country_flh
.. _plot_potentials: .. _plot_potentials:
Plot Potentials Rule :mod:`plot_p_nom_max`
=============== ==========================
.. 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.42 0.6 0.85",
fillcolor=gray,
label=plot_p_nom_max,
style=filled];
1 [color="0.58 0.6 0.85",
label=cluster_network];
1 -> 0;
}
|
.. automodule:: plot_p_nom_max .. automodule:: plot_p_nom_max
.. _summary: .. _summary:
Make Summary Rule :mod:`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 .. automodule:: make_summary
.. _summary_plot: .. _summary_plot:
Plot Summary Rule :mod:`plot_summary`
============ ========================
.. graphviz::
:align: center
|
.. automodule:: plot_summary .. automodule:: plot_summary
.. _map_plot: .. _map_plot:
Plot Network Rule :mod:`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 .. automodule:: plot_network

View File

@ -32,7 +32,6 @@ together into a detailed PyPSA network stored in ``networks/elec.nc``.
preparation/base_network preparation/base_network
preparation/build_bus_regions preparation/build_bus_regions
preparation/build_natura_raster preparation/build_natura_raster
preparation/build_country_flh
preparation/build_powerplants preparation/build_powerplants
preparation/build_renewable_profiles preparation/build_renewable_profiles
preparation/build_hydro_profile preparation/build_hydro_profile

View File

@ -3,4 +3,50 @@
Rule :mod:`add_electricity` Rule :mod:`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 .. automodule:: add_electricity

View File

@ -3,4 +3,47 @@
Rule :mod:`base_network` Rule :mod:`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 .. automodule:: base_network

View File

@ -3,4 +3,44 @@
Rule :mod:`build_bus_regions` Rule :mod:`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 .. automodule:: build_bus_regions

View File

@ -1,6 +0,0 @@
.. _flh:
Rule :mod:`build_country_flh`
=============================
.. automodule:: build_country_flh

View File

@ -3,4 +3,35 @@
Rule :mod:`build_cutout` Rule :mod:`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 .. automodule:: build_cutout

View File

@ -3,4 +3,38 @@
Rule :mod:`build_hydro_profile` Rule :mod:`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 .. automodule:: build_hydro_profile

View File

@ -3,4 +3,32 @@
Rule :mod:`build_natura_raster` Rule :mod:`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 .. automodule:: build_natura_raster

View File

@ -3,4 +3,35 @@
Rule :mod:`build_powerplants` Rule :mod:`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 .. automodule:: build_powerplants

View File

@ -3,4 +3,47 @@
Rule :mod:`build_renewable_profiles` Rule :mod:`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 .. automodule:: build_renewable_profiles

View File

@ -3,4 +3,44 @@
Rule :mod:`build_shapes` Rule :mod:`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 .. automodule:: build_shapes

View File

@ -3,4 +3,32 @@
Rule :mod:`prepare_links_p_nom` Rule :mod:`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 .. automodule:: prepare_links_p_nom

View File

@ -3,4 +3,36 @@
Rule :mod:`cluster_network` Rule :mod:`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 .. automodule:: cluster_network

View File

@ -3,4 +3,35 @@
Rule :mod:`prepare_network` Rule :mod:`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 .. automodule:: prepare_network

View File

@ -3,4 +3,38 @@
Rule :mod:`simplify_network` Rule :mod:`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 .. automodule:: simplify_network

View File

@ -3,4 +3,32 @@
Rule :mod:`solve_network` Rule :mod:`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 .. automodule:: solve_network

View File

@ -3,4 +3,35 @@
Rule :mod:`solve_operations_network` Rule :mod:`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 .. automodule:: solve_operations_network

View File

@ -3,4 +3,32 @@
Rule :mod:`trace_solve_network` Rule :mod:`trace_solve_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.17 0.6 0.85",
fillcolor=gray,
label=trace_solve_network,
style=filled];
1 [color="0.58 0.6 0.85",
label=prepare_network];
1 -> 0;
}
|
.. automodule:: trace_solve_network .. automodule:: trace_solve_network

View File

@ -24,12 +24,12 @@ Inputs
- ``data/bundle/corine/g250_clc06_V18_5.tif``: `CORINE Land Cover (CLC) <https://land.copernicus.eu/pan-european/corine-land-cover>`_ inventory on `44 classes <https://wiki.openstreetmap.org/wiki/Corine_Land_Cover#Tagging>`_ of land use (e.g. forests, arable land, industrial, urban areas). - ``data/bundle/corine/g250_clc06_V18_5.tif``: `CORINE Land Cover (CLC) <https://land.copernicus.eu/pan-european/corine-land-cover>`_ inventory on `44 classes <https://wiki.openstreetmap.org/wiki/Corine_Land_Cover#Tagging>`_ of land use (e.g. forests, arable land, industrial, urban areas).
.. image:: ../img/corine.png .. image:: img/corine.png
:scale: 33 % :scale: 33 %
- ``data/bundle/GEBCO_2014_2D.nc``: A `bathymetric <https://en.wikipedia.org/wiki/Bathymetry>`_ 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) <https://www.gebco.net/data_and_products/gridded_bathymetry_data/>`_. - ``data/bundle/GEBCO_2014_2D.nc``: A `bathymetric <https://en.wikipedia.org/wiki/Bathymetry>`_ 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) <https://www.gebco.net/data_and_products/gridded_bathymetry_data/>`_.
.. image:: ../img/gebco_2019_grid_image.jpg .. image:: img/gebco_2019_grid_image.jpg
:scale: 50 % :scale: 50 %
**Source:** `GEBCO <https://www.gebco.net/data_and_products/images/gebco_2019_grid_image.jpg>`_ **Source:** `GEBCO <https://www.gebco.net/data_and_products/images/gebco_2019_grid_image.jpg>`_