Skip to main content

deflex - flexible multi-regional energy system model for heat, power and mobility

Project description

deflex - flexible multi-regional energy system model forheat, power and mobility

  • Free software: MIT license


deflex is currently under revision. If you are planning to use deflex in the future you should install the upcoming version (see below)!


We will publish a stable version soon. Until then we recommend to install the already working beta version:

pip install

Use the latest stable (PhD) version of deflex to run older scenarios:

pip install

Additional requirements

The basic installation can be used to compute scenarios (csv, xls, xlsx). For some functions additional packages are needed.

  1. To run the example with all plots you need the following packages:
    • pygeos (spatial operations)
    • geopandas (maps)
    • descartes (plot maps with matplotlib)
    • lmfit (linear fit)
    • matplotlib (plotting)
    • requests (download example files)

    pip install deflex[example]

  2. To use the maps of the polygons, transmission lines etc.:
    • pygeos (spatial operations)
    • geopandas (maps)

    pip install deflex[map]

  3. To develop deflex:
    • pytest
    • sphinx
    • sphinx_rtd_theme
    • pygeos
    • geopandas
    • requests

    pip install deflex[dev]

Basic usage

scenario = "/path/to/my/scenario.xls"

Use example

  1. Create a local directory (e.g. /home/user/my_example).
  2. Download the example to this new directory.
  3. Now execute the example file. The script will download some example scenarios with results and show some exemplary plots.
  4. A directory “deflex_examples” will be created in you home directory. Use print(os.path.expanduser("~")) to find out where your home directory is located. If you want to change it replace the base path in the example:
- BASEPATH = os.path.join(os.path.expanduser("~"), "deflex_examples")
+ BASEPATH = "/your/favoured/path/"


The documentation of deflex is powered by readthedocs.

Go to the download page to download different versions and formats (pdf, html, epub) of the documentation.


We are warmly welcoming all who want to contribute to the deflex library.

Citing deflex

Go to the Zenodo page of deflex to find the DOI of your version. To cite all deflex versions use:


To run all the tests run:


Note, to combine the coverage data from all the tox environments run:

set PYTEST_ADDOPTS=--cov-append
PYTEST_ADDOPTS=--cov-append tox


0.2.0 (2021-01-25)

  • Move basic scenario with reegis dependency to new package
  • Revise structure
  • Add tox tests: pyflake, docs, coverage, tests, link-test, manifest, isort

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for deflex, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size deflex-0.2.0-py2.py3-none-any.whl (13.0 MB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size deflex-0.2.0.tar.gz (36.7 MB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page