Python interpreter for GEMS: modelling and simulation of complex energy systems under uncertainty
Project description
GemsPy
A Python interpreter for GEMS — modelling and simulating complex energy systems under uncertainty.
📖 Documentation •
🚀 Getting Started •
GEMS framework •
💬 Issues
✨ Why GemsPy
- 🧠 Low-code modelling — describe energy-system components in a high-level language close to mathematical syntax, minimal Python required.
- 🗂️ YAML-first workflow — read, edit and create case studies as plain YAML files, or build them programmatically from Python.
- ⚙️ Solver-agnostic — generates optimisation problems and delegates to off-the-shelf solvers.
- 🎲 Built for uncertainty — first-class support for time-dependent and scenario-dependent data.
- 🧪 Production-grade Python API — self-supporting, fully tested package, independent from any simulator binary.
📦 Installation
With uv (recommended):
uv add gemspy
Or with pip:
pip install gemspy
🚀 Quick start
Given a study directory containing your library.yml, system.yml and timeseries files (see the Getting started guide):
from pathlib import Path
from gems.study.folder import load_study
from gems.session import SimulationSession
from gems.optim_config import load_optim_config
study = load_study(Path("my_study"))
optim_config = load_optim_config(Path("my_study/input/optim-config.yml"))
session = SimulationSession(study=study, optim_config=optim_config)
results = session.run()
Or, in a single call:
from pathlib import Path
from gems.study.runner import run_study
run_study(Path("my_study"))
The GEMS framework
GEMS introduces a novel approach to modelling and simulating energy systems, centred around a simple principle: getting models out of the code.
To develop and test new models of energy-system components, writing software code should not be a prerequisite. This is where GEMS excels, offering users a low-code modelling experience with unparalleled versatility.
The framework consists of two pieces:
- 📝 a high-level modelling language, close to mathematical syntax;
- 🗃️ a data structure for describing energy systems.
🐍 The GemsPy package
GemsPy ships a generic interpreter of GEMS capable of generating optimisation problems from any study case that adheres to the modelling language syntax, then solving them with off-the-shelf solvers.
The Python API lets you:
- read case studies stored in YAML format,
- modify existing studies,
- or create new ones from scratch by scripting.
The Getting started page of the online documentation walks you through the GEMS input file format and the basics of the GemsPy API.
🔗 Link with Antares Simulator
GemsPy is part of the Antares project, but its implementation is completely independent from the Antares Simulator software. It was initially designed to prototype the next features of Antares, but its structuring and development practices have produced a high-quality, self-supporting codebase. It is now maintained to bring the flexibility of the GEMS modelling language and interpreter to Python users, and to keep exploring its potential.
📚 Documentation
Full documentation is hosted on Read the Docs: gemspy.readthedocs.io.
📄 License
Distributed under the Mozilla Public License 2.0. See LICENSE 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
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 gemspy-0.1.2.tar.gz.
File metadata
- Download URL: gemspy-0.1.2.tar.gz
- Upload date:
- Size: 88.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55aeef7ac32f049136d82381d488e03744329ef95489f2562f3cd14b11193487
|
|
| MD5 |
7655738f609dbf47fb9d8c395953e1f0
|
|
| BLAKE2b-256 |
068a4e4285e61e9d6716a19995cf0680373a7ec6dd573a659101b4c61d75043b
|
File details
Details for the file gemspy-0.1.2-py3-none-any.whl.
File metadata
- Download URL: gemspy-0.1.2-py3-none-any.whl
- Upload date:
- Size: 114.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dd4b7b8adb9dfde1e00717f0c92df77725701b9b8bf2e5cc796a03cb594e1c65
|
|
| MD5 |
5a9d1eca91f59ed39a3e0cc722b69c1d
|
|
| BLAKE2b-256 |
e2a5592b323148996541f80e4e812dddf92982d340afe5e14a765b62b590312c
|