2020-07-08 16:37:12 +00:00
|
|
|
.. _installation:
|
|
|
|
|
|
|
|
##########################################
|
|
|
|
Installation
|
|
|
|
##########################################
|
|
|
|
|
|
|
|
The subsequently described installation steps are demonstrated as shell commands, where the path before the ``%`` sign denotes the
|
|
|
|
directory in which the commands following the ``%`` should be entered.
|
|
|
|
|
2020-08-20 16:00:27 +00:00
|
|
|
Install PyPSA-Eur and its data
|
|
|
|
==============================
|
2020-07-08 16:37:12 +00:00
|
|
|
|
|
|
|
First install `PyPSA-Eur <https://github.com/PyPSA/pypsa-eur>`_ and all
|
|
|
|
its dependencies. Clone the repository:
|
|
|
|
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
2021-01-01 16:53:59 +00:00
|
|
|
projects % git clone https://github.com/PyPSA/pypsa-eur.git
|
2020-07-08 16:37:12 +00:00
|
|
|
|
2020-09-17 14:37:47 +00:00
|
|
|
then download and unpack all the PyPSA-Eur data files by running the following snakemake rule:
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
projects/pypsa-eur % snakemake -j 1 retrieve_databundle
|
2020-07-08 16:37:12 +00:00
|
|
|
|
|
|
|
|
2020-08-20 16:00:27 +00:00
|
|
|
|
2020-07-08 16:37:12 +00:00
|
|
|
Clone PyPSA-Eur-Sec repository
|
|
|
|
==============================
|
|
|
|
|
2020-08-21 10:16:15 +00:00
|
|
|
Create a parallel directory for `PyPSA-Eur-Sec <https://github.com/PyPSA/pypsa-eur-sec>`_ with:
|
2020-07-08 16:37:12 +00:00
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
2021-01-01 16:53:59 +00:00
|
|
|
projects % git clone https://github.com/PyPSA/pypsa-eur-sec.git
|
2020-07-08 16:37:12 +00:00
|
|
|
|
|
|
|
Environment/package requirements
|
|
|
|
================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The requirements are the same as `PyPSA-Eur <https://github.com/PyPSA/pypsa-eur>`_. For
|
|
|
|
``solve_network.py`` in addition you need ``gurobipy``. If you have
|
|
|
|
xarray version >= 0.15.1, you will need the latest master branch of
|
|
|
|
atlite version 0.0.2.
|
|
|
|
|
2022-11-18 08:08:07 +00:00
|
|
|
You can create an environment using the environment.yaml file in pypsa-eur/envs:
|
2021-01-01 16:53:59 +00:00
|
|
|
|
2021-11-16 12:36:46 +00:00
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
.../pypsa-eur % conda env create -f envs/environment.yaml
|
2021-01-01 16:53:59 +00:00
|
|
|
|
2021-11-16 12:36:46 +00:00
|
|
|
.../pypsa-eur % conda activate pypsa-eur
|
2021-01-01 16:53:59 +00:00
|
|
|
|
|
|
|
See details in `PyPSA-Eur Installation <https://pypsa-eur.readthedocs.io/en/latest/installation.html>`_
|
2020-07-08 16:37:12 +00:00
|
|
|
|
|
|
|
Data requirements
|
|
|
|
=================
|
|
|
|
|
2020-10-12 13:37:47 +00:00
|
|
|
Small data files are included directly in the git repository, while
|
2022-01-24 11:42:53 +00:00
|
|
|
larger ones are archived in a data bundle on zenodo (`10.5281/zenodo.5824485 <https://doi.org/10.5281/zenodo.5824485>`_).
|
2021-10-04 15:44:17 +00:00
|
|
|
The data bundle's size is around 640 MB.
|
2020-07-08 16:37:12 +00:00
|
|
|
|
2020-10-12 13:37:47 +00:00
|
|
|
To download and extract the data bundle on the command line:
|
2020-07-08 16:37:12 +00:00
|
|
|
|
|
|
|
.. code:: bash
|
2021-11-16 12:36:46 +00:00
|
|
|
|
2022-01-24 11:42:53 +00:00
|
|
|
projects/pypsa-eur-sec/data % wget "https://zenodo.org/record/5824485/files/pypsa-eur-sec-data-bundle.tar.gz"
|
2021-11-16 12:36:46 +00:00
|
|
|
projects/pypsa-eur-sec/data % tar -xvzf pypsa-eur-sec-data-bundle.tar.gz
|
2020-07-08 16:37:12 +00:00
|
|
|
|
2020-10-12 13:37:47 +00:00
|
|
|
|
|
|
|
The data licences and sources are given in the following table.
|
|
|
|
|
|
|
|
|
|
|
|
.. csv-table::
|
|
|
|
:header-rows: 1
|
|
|
|
:file: data.csv
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-07-08 16:37:12 +00:00
|
|
|
Set up the default configuration
|
|
|
|
================================
|
|
|
|
|
2021-07-03 10:59:09 +00:00
|
|
|
First make your own copy of the ``config.yaml`` based on
|
|
|
|
``config.default.yaml``. For example:
|
2020-07-08 16:37:12 +00:00
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
|
|
|
projects/pypsa-eur-sec % cp config.default.yaml config.yaml
|
|
|
|
|
|
|
|
|
|
|
|
Getting started
|
|
|
|
===============
|
|
|
|
|
|
|
|
|
|
|
|
In ``config.yaml`` you can control the settings for the scenarios you
|
|
|
|
want to run, such as the number of nodes, the CO2 limit, the
|
|
|
|
installable potentials for solar and wind, which technologies are
|
|
|
|
activated, etc.
|
|
|
|
|
|
|
|
To run the full optimization with your settings:
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
2020-08-20 16:00:27 +00:00
|
|
|
projects/pypsa-eur-sec % snakemake -j1
|
2020-07-08 16:37:12 +00:00
|
|
|
|
|
|
|
Warning: you may need a computer cluster for this (with e.g. 10-100 GB of RAM
|
|
|
|
and several processors).
|
|
|
|
|
|
|
|
To only prepare the networks, you can run the scripts up to the point before optimization:
|
|
|
|
|
|
|
|
.. code:: bash
|
|
|
|
|
2020-08-20 16:00:27 +00:00
|
|
|
projects/pypsa-eur-sec % snakemake -j1 prepare_sector_networks
|