Skip to content

Commit

Permalink
Release v0.3 (#213)
Browse files Browse the repository at this point in the history
* release_notes: order for release

* doc: fix smaller typos and tidy up

* config: bump version

* doc: fix line references

* doc: bump confpy version

* envs: update fixed versions yaml

* Snakefile: simplify all_elec to all
  • Loading branch information
fneum authored Dec 5, 2020
1 parent 3ad6340 commit 08674a6
Show file tree
Hide file tree
Showing 24 changed files with 323 additions and 311 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ before_install:

script:
- cp ./test/config.test1.yaml ./config.yaml
- snakemake -j all solve_all_elec_networks
- snakemake -j all solve_all_networks
- rm -rf resources/*.nc resources/*.geojson resources/*.h5 networks results
# could repeat for more configurations in future
8 changes: 4 additions & 4 deletions Snakefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,19 @@ wildcard_constraints:
opts="[-+a-zA-Z0-9\.]*"


rule cluster_all_elec_networks:
rule cluster_all_networks:
input: expand("networks/elec_s{simpl}_{clusters}.nc", **config['scenario'])


rule extra_components_all_elec_networks:
rule extra_components_all_networks:
input: expand("networks/elec_s{simpl}_{clusters}_ec.nc", **config['scenario'])


rule prepare_all_elec_networks:
rule prepare_all_networks:
input: expand("networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc", **config['scenario'])


rule solve_all_elec_networks:
rule solve_all_networks:
input: expand("results/networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc", **config['scenario'])


Expand Down
2 changes: 1 addition & 1 deletion config.default.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: CC0-1.0

version: 0.2.0
version: 0.3.0
tutorial: false

logging:
Expand Down
3 changes: 2 additions & 1 deletion config.tutorial.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
#
# SPDX-License-Identifier: CC0-1.0

version: 0.2.0
version: 0.3.0
tutorial: true

logging:
level: INFO
format: '%(levelname)s:%(name)s:%(message)s'
Expand Down
5 changes: 0 additions & 5 deletions doc/_static/theme_overrides.css
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,6 @@
background: #ffffff;
}

.wy-nav-content .highlight .nn,
.wy-nav-content .admonition.warning a {
color: #dddddd;
}

.rst-content code.literal,
.rst-content tt.literal {
color: rgb(34, 97, 156)
Expand Down
4 changes: 2 additions & 2 deletions doc/cloudcomputing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Now a window with the machine details will open. You have to configure the follo
You can edit your machine configuration later. So use a cheap machine type configuration to transfer data and
only when everything is ready and tested, your expensive machine type, for instance a custom 8 vCPU with 160 GB memory.
Solvers do not parallelise well, so we recommend not to choose more than 8 vCPU.
Check ``snakemake -j -n 1 solve_all_elec_networks`` as a dry run to see how much memory is required.
Check ``snakemake -n -j 1 solve_all_networks`` as a dry run to see how much memory is required.
The memory requirements will vary depending on the spatial and temporal resoulution of your optimisation.
Example: for an hourly, 181 node full European network, set 8 vCPU and 150 GB memory since the dry-run calculated a 135 GB memory requirement.)
- Boot disk: As default, your VM is created with 10 GB. Depending on how much you want to handle on one VM you should increase the disk size.
Expand All @@ -85,7 +85,7 @@ Step 3 - Installation of Cloud SDK
sudo apt-get update
sudo apt-get install bzip2 libxml2-dev
sudo apt-get install wget
wget https://repo.anaconda.com/archive/Anaconda3-2020.07-Linux-x86_64.sh (Check the link. To be up to date with anaconda, check the Anaconda website https://www.anaconda.com/products/individual )
wget https://repo.anaconda.com/archive/Anaconda3-2020.07-Linux-x86_64.sh
ls (to see what anaconda file to bash)
bash Anaconda3-2020.07-Linux-x86_64.sh
source ~/.bashrc
Expand Down
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@
# built documents.
#
# The short X.Y version.
version = u'0.2'
version = u'0.3'
# The full version, including alpha/beta/rc tags.
release = u'0.2.0'
release = u'0.3.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
2 changes: 1 addition & 1 deletion doc/configtables/opts.csv
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Trigger, Description, Definition, Status
``nH``; i.e. ``2H``-``6H``, Resample the time-resolution by averaging over every ``n`` snapshots, ``prepare_network``: `average_every_nhours() <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/prepare_network.py#L110>`_ and its `caller <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/prepare_network.py#L146>`_), In active use
``nSEG``; e.g. ``4380SEG``, "Apply time series segmentation with `tsam <https://tsam.readthedocs.io/en/latest/index.html>`_ package to ``n`` adjacent snapshots of varying lengths based on capacity factors of varying renewables, hydro inflow and load.", ``prepare_network``: ``apply_time_segmentation(), In active use
``nSEG``; e.g. ``4380SEG``, "Apply time series segmentation with `tsam <https://tsam.readthedocs.io/en/latest/index.html>`_ package to ``n`` adjacent snapshots of varying lengths based on capacity factors of varying renewables, hydro inflow and load.", ``prepare_network``: apply_time_segmentation(), In active use
``Co2L``, Add an overall absolute carbon-dioxide emissions limit configured in ``electricity: co2limit``. If a float is appended an overall emission limit relative to the emission level given in ``electricity: co2base`` is added (e.g. ``Co2L0.05`` limits emissisions to 5% of what is given in ``electricity: co2base``), ``prepare_network``: `add_co2limit() <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/prepare_network.py#L19>`_ and its `caller <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/prepare_network.py#L154>`_, In active use
``Ep``, Add cost for a carbon-dioxide price configured in ``costs: emission_prices: co2`` to ``marginal_cost`` of generators (other emission types listed in ``network.carriers`` possible as well), ``prepare_network``: `add_emission_prices() <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/prepare_network.py#L24>`_ and its `caller <https://github.com/PyPSA/pypsa-eur/blob/6b964540ed39d44079cdabddee8333f486d0cd63/scripts/prepare_network.py#L158>`_, In active use
``CCL``, Add minimum and maximum levels of generator nominal capacity per carrier for individual countries. These can be specified in the file linked at ``electricity: agg_p_nom_limits`` in the configuration. File defaults to ``data/agg_p_nom_minmax.csv``., ``solve_network``, In active use
Expand Down
9 changes: 4 additions & 5 deletions doc/configuration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Top-level configuration

.. literalinclude:: ../config.default.yaml
:language: yaml
:lines: 5-12,21,28-34
:lines: 5-12,20,27-34

.. csv-table::
:header-rows: 1
Expand All @@ -40,9 +40,9 @@ facilitate running multiple scenarios through a single command

.. code:: bash
snakemake -j 1 solve_all_elec_networks
snakemake -j 1 solve_all_networks
For each wildcard, a **list of values** is provided. The rule ``solve_all_elec_networks`` will trigger the rules for creating ``results/networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc`` for **all combinations** of the provided wildcard values as defined by Python's `itertools.product(...) <https://docs.python.org/2/library/itertools.html#itertools.product>`_ function that snakemake's `expand(...) function <https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#targets>`_ uses.
For each wildcard, a **list of values** is provided. The rule ``solve_all_networks`` will trigger the rules for creating ``results/networks/elec_s{simpl}_{clusters}_ec_l{ll}_{opts}.nc`` for **all combinations** of the provided wildcard values as defined by Python's `itertools.product(...) <https://docs.python.org/2/library/itertools.html#itertools.product>`_ function that snakemake's `expand(...) function <https://snakemake.readthedocs.io/en/stable/snakefiles/rules.html#targets>`_ uses.

An exemplary dependency graph (starting from the simplification rules) then looks like this:

Expand Down Expand Up @@ -80,7 +80,7 @@ Specifies the temporal range to build an energy system model for as arguments to

.. literalinclude:: ../config.default.yaml
:language: yaml
:lines: 36-55
:lines: 36-60

.. csv-table::
:header-rows: 1
Expand Down Expand Up @@ -241,7 +241,6 @@ Specifies the temporal range to build an energy system model for as arguments to

.. note::
To change cost assumptions in more detail (i.e. other than ``marginal_cost`` and ``capital_cost``), consider modifying cost assumptions directly in ``data/costs.csv`` as this is not yet supported through the config file.

You can also build multiple different cost databases. Make a renamed copy of ``data/costs.csv`` (e.g. ``data/costs-optimistic.csv``) and set the variable ``COSTS=data/costs-optimistic.csv`` in the ``Snakefile``.

.. _solving_cf:
Expand Down
2 changes: 1 addition & 1 deletion doc/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ be it with new ideas, suggestions, by filing bug reports or contributing code
to our `GitHub repository <https://github.com/PyPSA/PyPSA-Eur>`_.

* If you already have some code changes, you can submit them directly as a `pull request <https://github.com/PyPSA/pypsa-eur/pulls>`_.
* If you are wondering where we would greatly appreciate your efforts, check out the ``help wanted`` tag in the `issues list <https://github.com/PyPSA/pypsa-eur/issues`_ and initiate a discussion there..
* If you are wondering where we would greatly appreciate your efforts, check out the ``help wanted`` tag in the `issues list <https://github.com/PyPSA/pypsa-eur/issues>`_ and initiate a discussion there.
* If you start working on a feature in the code, let us know by opening an issue or a draft pull request.
This helps all of us to keep an overview on what is being done and helps to avoid a situation where we
are doing the same work twice in parallel.
Expand Down
2 changes: 1 addition & 1 deletion doc/costs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Based on the parameters above the ``marginal_cost`` and ``capital_cost`` of the

.. note::

Another great resource for `cost assumptions <https://ens.dk/en/our-services/projections-and-models/technology-data`_ is the cost database from the Danish Energy Agency.
Another great resource for cost assumptions is the `cost database from the Danish Energy Agency <https://ens.dk/en/our-services/projections-and-models/technology-data>`_.

Modifying Cost Assumptions
==========================
Expand Down
2 changes: 2 additions & 0 deletions doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ It contains alternating current lines at and above 220 kV voltage level and all
The model is suitable both for operational studies and generation and transmission expansion planning studies. The continental scope and highly resolved spatial scale enables a proper description of the long-range smoothing effects for renewable power generation and their varying resource availability.

.. image:: img/base.png
:width: 50%
:align: center

The restriction to freely available and open data encourages the open exchange of model data developments and eases the comparison of model results. It provides a full, automated software pipeline to assemble the load-flow-ready model from the original datasets, which enables easy replacement and improvement of the individual parts.

Expand Down
20 changes: 8 additions & 12 deletions doc/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@ Clone the Repository

First of all, clone the `PyPSA-Eur repository <https://github.com/PyPSA/pypsa-eur>`_ using the version control system ``git``.
The path to the directory into which the ``git repository`` is cloned, must **not** have any spaces!
If you do not have ``git`` installed, follow installation instructions `here <https://git-scm.com/book/en/v2/Getting-Started-Installing-Git>`_.

.. code:: bash
/some/other/path % cd /some/path/without/spaces
/some/path/without/spaces % git clone https://github.com/PyPSA/pypsa-eur.git
.. note::
If you do not have ``git`` installed, follow installation instructions `here <https://git-scm.com/book/en/v2/Getting-Started-Installing-Git>`_.
.. _deps:

Expand All @@ -46,9 +45,8 @@ The environment can be installed and activated using
.../pypsa-eur % conda activate pypsa-eur
.. note::
Note that activation is local to the currently open shell!
After opening a new terminal window, one needs to reissue the second command!
Note that activation is local to the currently open shell!
After opening a new terminal window, one needs to reissue the second command!

.. note::
If you have troubles with a slow ``conda`` installation, we recommend to install
Expand All @@ -74,25 +72,23 @@ PyPSA is known to work with the free software
- `Cbc <https://projects.coin-or.org/Cbc#DownloadandInstall>`_
- `GLPK <https://www.gnu.org/software/glpk/>`_ (`WinGLKP <http://winglpk.sourceforge.net/>`_)

and the non-free, commercial software (for which free academic licenses are available)
and the non-free, commercial software (for some of which free academic licenses are available)

- `Gurobi <https://www.gurobi.com/documentation/quickstart.html>`_
- `CPLEX <https://www.ibm.com/products/ilog-cplex-optimization-studio>`_
- `FICO® Xpress Solver <https://www.fico.com/de/products/fico-xpress-solver>`_

and any other solver that works with the underlying modelling framework `Pyomo <http://www.pyomo.org/>`_.
For installation instructions of these solvers for your operating system, follow the links above.
Commercial solvers such as Gurobi and CPLEX currently significantly outperform open-source solvers for large-scale problems.
It might be the case that you can only retrieve solutions by using a commercial solver.

.. seealso::
`Getting a solver in the PyPSA documentation <https://pypsa.readthedocs.io/en/latest/installation.html#getting-a-solver-for-linear-optimisation>`_

.. note::
Commercial solvers such as Gurobi and CPLEX currently significantly outperform open-source solvers for large-scale problems.
It might be the case that you can only retrieve solutions by using a commercial solver.

.. note::
The rules :mod:`cluster_network` and :mod:`simplify_network` solve a quadratic optimisation problem for clustering.
The open-source solvers Cbc and GlPK cannot handle this. A fallback to Ipopt is implemented in this case, but requires
also Ipopt to be installed. For an open-source solver setup install in your `conda` environment on OSX/Linux
also Ipopt to be installed. For an open-source solver setup install in your ``conda`` environment on OSX/Linux

.. code:: bash
Expand Down
4 changes: 3 additions & 1 deletion doc/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,6 @@ Folder Structure
System Requirements
===================

Building the model with the scripts in this repository uses up to 20 GB of memory. Computing optimal investment and operation scenarios requires a strong interior-point solver compatible with the modelling library `Pyomo <https://www.pyomo.org>`_ like `Gurobi <http://www.gurobi.com/>`_ or `CPLEX <https://www.ibm.com/analytics/cplex-optimizer>`_ with up to 100 GB of memory.
Building the model with the scripts in this repository runs on a normal computer.
But computing optimal investment and operation scenarios requires a strong interior-point solver
like `Gurobi <http://www.gurobi.com/>`_ or `CPLEX <https://www.ibm.com/analytics/cplex-optimizer>`_ with more memory.
Loading

0 comments on commit 08674a6

Please sign in to comment.