Metadata-Version: 2.4
Name: antares-legacy-gems-converter
Version: 0.2.0
Summary: Convert Antares Legacy studies to GEMS format
Author: Antoine Oustry @aoustry, Dušan Paripović @dusanparipovic, Nikola Ilić @nikolaredstork, Thomas Bittar @tbittar, Juliette Gerbaux @Juliette-Gerbaux
License-Expression: MPL-2.0
Project-URL: Issues, https://github.com/AntaresSimulatorTeam/AntaresLegacyModels-to-GEMS-Converter/issues
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: antares_craft==0.14.0
Requires-Dist: antares-study-version==1.0.20
Requires-Dist: antares-timeseries-generation==0.1.9
Requires-Dist: numpy>=2.2.6
Requires-Dist: pandas>=2.2.3
Requires-Dist: pydantic>=2.11.10
Requires-Dist: gemspy==0.1.2
Requires-Dist: PyYAML>=6.0.3
Dynamic: license-file

# AntaresLegacyModels-to-GEMS-Converter

[![License: MPL v2](https://img.shields.io/badge/License-MPLv2-blue.svg)](https://www.mozilla.org/en-US/MPL/2.0/)
[![Python](https://img.shields.io/badge/python-3.x-blue.svg)](https://www.python.org/)

A Python tool that converts [Antares Simulator](https://antares-simulator.readthedocs.io/en/latest/) legacy studies into the [GEMS](https://gems-energy.readthedocs.io/en/latest/) format.

## Background

[Antares Simulator](https://antares-simulator.readthedocs.io/en/latest/) is an open-source power system simulator developed by RTE to assess the adequacy and economic performance of interconnected energy systems. Historically, the mathematical models of its components — thermal clusters, hydro units, short-term storage, and so on — were defined implicitly inside the solver's code.

[GEMS](https://gems-energy.readthedocs.io/en/latest/) (Generic Energy Modelling Scheme) is a high-level modelling language that brings these model definitions out of the codebase and into plain YAML files, where variables, parameters, and constraints are expressed using natural mathematical syntax. A GEMS model library can be used directly with [Antares Simulator's dynamic modeler](https://antares-simulator.readthedocs.io/en/latest/user-guide/modeler/01-overview-modeler/) or with the [GemsPy](https://github.com/AntaresSimulatorTeam/GemsPy) Python interpreter.

## Purpose

This tool automates the translation of Antares Simulator studies into valid GEMS system files (YAML), making it straightforward to migrate existing studies to the new modelling framework — with no manual rewriting required.

## Installation

Requires Python 3.11+.

**From PyPI:**

```bash
pip install antares-legacy-gems-converter
```

**From source (for development):**

Requires [uv](https://docs.astral.sh/uv/). Python library versions are pinned in `pyproject.toml` and locked in `uv.lock` (see [COMPATIBILITY.md](COMPATIBILITY.md#python-library-dependencies)).

```bash
git clone https://github.com/AntaresSimulatorTeam/AntaresLegacyModels-to-GEMS-Converter.git
cd AntaresLegacyModels-to-GEMS-Converter
uv sync --group dev
```

## Usage

First, fill in a configuration file (INI format):

```ini
[study]
study_path    = /path/to/your/antares-study
output_folder = /path/to/output
lib_paths     = /path/to/antares_legacy_models.yml
mode          = FULL
```

For **HYBRID** mode, also add:

```ini
[hybrid]
model_list = thermal, battery
```

Then run the converter:

```bash
antares-to-gems --conf path/to/config.ini --logging path/to/output.log
```

The `--conf` and `--logging` arguments are optional — they default to `data/config.ini` and `data/logging.log` respectively.

## Related projects

| Project | Description |
|---|---|
| [Antares Simulator](https://github.com/AntaresSimulatorTeam/Antares_Simulator) | Open-source power system simulator |
| [GEMS](https://gems-energy.readthedocs.io/en/latest/) | Graph-based algebraic modelling language |
| [GemsPy](https://github.com/AntaresSimulatorTeam/GemsPy) | Python interpreter for the GEMS modelling framework |
| [PyPSA-to-GEMS-Converter](https://github.com/AntaresSimulatorTeam/PyPSA-to-GEMS-Converter) | Converter from PyPSA models to GEMS format |

## License

[Mozilla Public License v2.0](LICENSE)
