Skip to content

Commit

Permalink
Merge pull request #88 from rl-institut/fixes/scripts-automodule
Browse files Browse the repository at this point in the history
Clean up ducumentation of scripts
  • Loading branch information
jnnr authored Nov 15, 2021
2 parents beeed12 + 6d043cc commit d1dadb3
Show file tree
Hide file tree
Showing 18 changed files with 146 additions and 27 deletions.
14 changes: 14 additions & 0 deletions docs/model_pipeline.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,24 @@ Optimization
:maxdepth: 1
:glob:

optimization/*


Postprocessing
==============

.. toctree::
:maxdepth: 1
:glob:

postprocessing/*


Plotting
==============

.. toctree::
:maxdepth: 1
:glob:

plotting/*
6 changes: 6 additions & 0 deletions docs/optimization/optimize.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _optimize_label:

optimize
========

.. automodule:: optimize
6 changes: 6 additions & 0 deletions docs/plotting/plot_dispatch.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _plot_dispatch_label:

plot_dispatch
=============

.. automodule:: plot_dispatch
6 changes: 6 additions & 0 deletions docs/plotting/plot_joined_scalars.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _plot_joined_label:

plot_joined
===========

.. automodule:: plot_joined_scalars
6 changes: 6 additions & 0 deletions docs/postprocessing/join_scenarios.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _join_scenarios_label:

join_scenarios
==============

.. automodule:: join_scenarios
6 changes: 6 additions & 0 deletions docs/postprocessing/postprocess.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.. _postprocess_label:

postprocess
===========

.. automodule:: postprocess
4 changes: 2 additions & 2 deletions scripts/build_datapackage.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
Inputs
-------
scenario_specs : str
path of input file (.yml) containing scenario specifications
``scenarios/{scenario}.yml``: path of input file (.yml) containing scenario specifications
destination : str
path of output directory
``results/{scenario}/preprocessed``: path of output directory
Outputs
---------
Expand Down
5 changes: 3 additions & 2 deletions scripts/join_scenarios.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
Inputs
-------
list_scenarios : path
Path to yaml-file containing a list of scenarios.
``scenario_groups/{scenario_list}.yml``: Path to yaml-file containing a list of scenarios.
destination : path
Path of output file to store joined scalar results.
``results/joined_scenarios/{scenario_list}/joined/scalars.csv``: Path of output file to store
joined scalar results.
Outputs
---------
Expand Down
23 changes: 21 additions & 2 deletions scripts/optimize.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
# coding: utf-8
r"""
Inputs
-------
preprocessed : str
``results/{scenario}/preprocessed``
optimized : str
``results/{scenario}/optimized/``
Outputs
---------
es.dump
oemof.solph.EnergySystem with results, meta-results and parameters
Description
-------------
Given an EnergyDataPackage, this script creates an oemof.solph.EnergySystem and an
oemof.solph.Model, which is optimized. The EnergySystem with results, meta-results and parameters
is saved.
"""
import os
import sys

Expand Down Expand Up @@ -37,6 +57,5 @@
es.results = processing.results(m)
es.params = processing.parameter_as_dict(es)

# now we use the write results method to write the results in oemoftabular
# format
# dump the EnergySystem
es.dump(optimized)
6 changes: 4 additions & 2 deletions scripts/plot_dispatch.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# coding: utf-8
r"""
Inputs
-------
postprocessed : str
path to directory which contains the input data which can be plotted
``results/{scenario}/postprocessed/``: path to directory which contains the input data which
can be plotted
plotted : str
path where a new directory is created and the plots are saved
``results/{scenario}/plotted/``: path where a new directory is created and the plots are saved
Outputs
---------
Expand Down
6 changes: 4 additions & 2 deletions scripts/plot_joined_scalars.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# coding: utf-8
r"""
Inputs
-------
scalars_path : str
path to csv with scalar data.
``results/joined_scenarios/{scenario_list}/joined/scalars.csv``: path to csv with scalar data.
target : str
path where a new directory is created and the plots are saved.
``results/joined_scenarios/{scenario_list}/joined_plotted/``: path where a new directory is
created and the plots are saved.
Outputs
---------
Expand Down
20 changes: 20 additions & 0 deletions scripts/postprocess.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
# coding: utf-8
r"""
Inputs
-------
optimized : str
``results/{scenario}/optimized``
scenario_name : str
`` ``
destination : str
``results/{scenario}/preprocessed``
Outputs
---------
oemoflex.ResultsDatapackage
ResultsDatapackage
Description
-------------
Postprocess the results of an optimization.
"""
import sys

from oemof.solph import EnergySystem
Expand Down
12 changes: 7 additions & 5 deletions scripts/prepare_conv_pp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@
Inputs
-------
in_path1 : str
path of input file with raw opsd data as .csv
``raw/conventional_power_plants_DE.csv``: path of input file with raw opsd data as .csv
in_path2 : str
path of input file with geodata of regions in Germany as .gpgk
``raw/boundaries_germany_nuts3.gpkg``: path of input file with geodata of regions in Germany
as .gpgk
in_path3 : str
path of input file with names of regions in Berlin and Brandenburg as .yaml
``raw/b3_regions.yaml``: path of input file with names of regions in Berlin and Brandenburg
as .yaml
in_path4 : str
path of template for scalar data as .csv
``oemof_b3/schema/scalars.csv``: path of template for scalar data as .csv
out_path : str
path of output file with prepared data as .csv
``results/_resources/conv_pp_scalar.csv``: path of output file with prepared data as .csv
Outputs
---------
Expand Down
1 change: 1 addition & 0 deletions scripts/prepare_electricity_demand.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# coding: utf-8
r"""
Inputs
-------
Expand Down
10 changes: 8 additions & 2 deletions scripts/prepare_feedin.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,15 @@
Inputs
-------
filename_wind : str
Path incl. file name to wind feed-in time series of renewables ninja
``raw/time_series/ninja_wind_country_DE_current_merra-2_nuts-2_corrected.csv``: Path incl. file
name to wind feed-in time series of renewables ninja
filename_pv : str
Path incl. file name to pv feed-in time series of renewables ninja
``raw/time_series/ninja_pv_country_DE_merra-2_nuts-2_corrected.csv``: Path incl. file name to pv
feed-in time series of renewables ninja
filename_for : str
``raw/time_series/DIW_Hydro_availability.csv``:
output_file : str
``results/_resources/feedin_time_series.csv``:
Outputs
---------
Expand Down
16 changes: 16 additions & 0 deletions scripts/prepare_heat_demand.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# coding: utf-8
r"""
Inputs
-------
preprocessed : str
``results/{scenario}/preprocessed``
optimized : str
``results/{scenario}/optimized/``
Outputs
---------
Description
-------------
"""
18 changes: 11 additions & 7 deletions scripts/prepare_re_potential.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@
Inputs
-------
filename_pv_agriculture : str
Path incl. file name to area potential agriculture pv csv
``raw/area_potential/2021-05-18_pv_agriculture_brandenburg_kreise_epsg32633.csv``: Path incl.
file name to area potential agriculture pv csv
filename_pv_road_railway : str
Path incl. file name to area potential roads and railway pv csv
``raw/area_potential/2021-05-18_pv_road_railway_brandenburg_kreise_epsg32633.csv``: Path incl.
file name to area potential roads and railway pv csv
filename_wind : str
Path incl. file name to area potential wind csv
``raw/area_potential/2021-05-18_wind_brandenburg_kreise_epsg32633.csv``: Path incl. file name
to area potential wind csv
filename_kreise : str
Path incl. file name to lookup table Kreise and NUTS of Brandenburg
``raw/lookup_table_brandenburg_kreise.csv``: Path incl. file name to lookup table Kreise and
NUTS of Brandenburg
filename_assumptions : str
Path incl. file name to assumptions csv
``raw/scalars.csv``: Path incl. file name to assumptions csv
output_dir : str
Path to output directory where power and area potential of single areas and of "Landkreise" is
saved
``results/_resources/RE_potential/``: Path to output directory where power and area potential of
single areas and of "Landkreise" is saved
Outputs
---------
Expand Down
8 changes: 5 additions & 3 deletions scripts/process_re_potential.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
Inputs
-------
input_dir : str
Path to input directory of renewable potential
``results/_resources/RE_potential/``: Path to input directory of renewable potential
output_scalars : str
Path incl. file name to scalar output as input to energy system model
``results/_resources/wind_pv_scalar.csv``: Path incl. file name to scalar output as input to
energy system model
output_tables : str
Path incl. file name to output for results documentation
``results/_tables/potential_wind_pv_kreise.csv``: Path incl. file name to output for results
documentation
Outputs
---------
Expand Down

0 comments on commit d1dadb3

Please sign in to comment.