A Python framework for modeling and optimizing energy systems based on the energy hub concept
Project description
ehubX
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
-
Clone the ehubX repository.
-
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).
-
Activate the environment:
conda activate ehubx -
Install poetry for dependency management:
conda install -c conda-forge poetry -
Navigate to the cloned ehubX directory and install using poetry:
cd PATH_TO_EHUBX_REPO poetry install -
Run any of the main scripts in the examples folder to verify the installation.
Documentation
The complete documentation is available at:
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
855c87e9e6d00fef1144b0f52503f68e0ec2c3dd9e5e23ea9f5010dab137e404
|
|
| MD5 |
83b12ccfe3b58e1f5f921a2e47d324eb
|
|
| BLAKE2b-256 |
b792455089e4ec0cf080c6cc73c04c3f69e6e8d716c5b6ed0f627714305c5b42
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10ab0999590ad0558415f0395d1c47a28c106d21e3f295531f9e4ae2bb1641b5
|
|
| MD5 |
03a8ecdd3286fbc428442286696224c4
|
|
| BLAKE2b-256 |
c73f5367e30011d6b1903773ba2b1afbcd859cb490721b7f605dcbf7a163169d
|