Skip to main content

A Python framework for modeling and optimizing energy systems based on the energy hub concept

Project description

ehubX

CI Documentation Status License Python

ehubX is a Python framework for optimization-based energy system modeling developed by the Urban Energy Systems Laboratory at Empa. It has been applied in numerous large-scale energy system analyses for both scientific research and municipal planning projects.

Energy system models are defined through a combination of YAML configuration files and CSV input data. ehubX translates these inputs into Mixed-Integer Linear Programming (MILP) models that can be solved using a variety of external optimization solvers.

Its modular architecture supports a wide range of modeling capabilities, including:

  • Energy imports, exports, demands, load shedding, and load shifting
  • Storage, conversion, solar, wind, and electromobility technologies
  • Energy network modeling and transfer
  • Multi-stage, multi-hub, and multi-objective optimization
  • Single- and multi-objective optimization with objectives such as costs, emissions, and self-sufficiency

Installation

We recommend setting up ehubX in a dedicated Python virtual environment to avoid conflicts with other packages. The step-by-step guide below is formulated using conda but can be adapted for other package managers or a manual setup. Similarly, we use poetry for dependency management, which can be replaced with pip if preferred.

Since ehubX relies on external MILP solvers, additionally ensure that you have a compatible solver installed and properly configured in your environment (see Specify solver in the documentation).

Steps

  1. Clone the ehubX repository.

  2. Create a new virtual environment:

    conda create -n ehubx python=PYTHON_VERSION
    

Make sure that the PYTHON_VERSION you choose is a compatible with the current version of ehubX (see pyproject.toml in the root directory).

  1. Activate the environment:

    conda activate ehubx
    
  2. Install poetry for dependency management:

    conda install -c conda-forge poetry
    
  3. Navigate to the cloned ehubX directory and install using poetry:

    cd PATH_TO_EHUBX_REPO
    poetry install
    
  4. Run any of the main scripts in the examples folder to verify the installation.

Documentation

The complete documentation is available at:

https://ehubx.readthedocs.io/

Examples

The examples directory contains demo projects that give an impression on how to work with ehubX models. The most academic example and a good place to start is the small_demo.

How to cite

TODO

License

Copyright (C) 2026 Urban Energy Systems Laboratory, Empa.

This project is licensed under the GNU General Public License v3.0 or later. See the LICENSE file for details.

Project details


Download files

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

Source Distribution

ehubx-2.3.0.tar.gz (264.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ehubx-2.3.0-py3-none-any.whl (340.7 kB view details)

Uploaded Python 3

File details

Details for the file ehubx-2.3.0.tar.gz.

File metadata

  • Download URL: ehubx-2.3.0.tar.gz
  • Upload date:
  • Size: 264.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for ehubx-2.3.0.tar.gz
Algorithm Hash digest
SHA256 855c87e9e6d00fef1144b0f52503f68e0ec2c3dd9e5e23ea9f5010dab137e404
MD5 83b12ccfe3b58e1f5f921a2e47d324eb
BLAKE2b-256 b792455089e4ec0cf080c6cc73c04c3f69e6e8d716c5b6ed0f627714305c5b42

See more details on using hashes here.

File details

Details for the file ehubx-2.3.0-py3-none-any.whl.

File metadata

  • Download URL: ehubx-2.3.0-py3-none-any.whl
  • Upload date:
  • Size: 340.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for ehubx-2.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 10ab0999590ad0558415f0395d1c47a28c106d21e3f295531f9e4ae2bb1641b5
MD5 03a8ecdd3286fbc428442286696224c4
BLAKE2b-256 c73f5367e30011d6b1903773ba2b1afbcd859cb490721b7f605dcbf7a163169d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page