Skip to main content

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.

CI PyPI version Python versions License: MPL-2.0 Documentation Code style: black

📖 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_craft.study.folder import load_study
from gems_runner.session import SimulationSession
from gems_craft.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_runner.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

gemspy-0.1.3.tar.gz (90.7 kB view details)

Uploaded Source

Built Distribution

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

gemspy-0.1.3-py3-none-any.whl (120.8 kB view details)

Uploaded Python 3

File details

Details for the file gemspy-0.1.3.tar.gz.

File metadata

  • Download URL: gemspy-0.1.3.tar.gz
  • Upload date:
  • Size: 90.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for gemspy-0.1.3.tar.gz
Algorithm Hash digest
SHA256 49325e19f37be1f1b1dc394fab4f29d85b813a95256a5da62756936100c5341a
MD5 758636b3e5f8014493569553bbb915e6
BLAKE2b-256 fee28260139805f657cdd5dd2d5f3e02c974c05e4cd3ac83724b6b759c488892

See more details on using hashes here.

File details

Details for the file gemspy-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: gemspy-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 120.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for gemspy-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 115dd4b344551ab3e4f6cadc68328e9926d01f1297fe1227e25c61b34aebf0bd
MD5 ae3d18941f08641ecde55d36f62a9971
BLAKE2b-256 95d4208b59a521ba66f75de1e5757401ce029469e4d537ff559602d670f641b3

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