A FastAPI-based web service for generating Antares studies with areas, links, and load data.
Antares Datamanager Generator is a tool designed to automate the creation of Antares studies. It provides a simple API endpoint that takes a study ID, loads the corresponding configuration from a JSON file, and generates a complete study with:
- Areas with random coordinates and colors
- Links between areas with capacity data
- Load data for areas from feather files
The generator is designed to work with the Antares simulation platform and simplifies the process of creating new studies for simulation.
- Python 3.10 or higher
- Access to an Antares API instance
pip install antares-datamanager-generatorFor development purposes, install the development requirements:
pip install -r requirements-dev.txtThe generator requires the following environment variables:
NAS_PATH: Path to the NAS storagePEGASE_LOAD_OUTPUT_DIRECTORY: Directory containing load data files
To generate a study, make a POST request to the /generate_study/ endpoint with a study ID:
curl -X POST "http://localhost:8094/generate_study/?study_id=my_study_id"The study ID should correspond to a JSON file in the configured load directory with the following structure:
{
"study_name": {
"areas": {
"area1": {
"loads": ["load_file1.feather", "load_file2.feather"]
},
"area2": {
"loads": []
}
},
"links": {
"area1/area2": {
"direct": 1000,
"indirect": 1000
}
}
}
}- FastAPI-based web service
- Automatic generation of areas with random coordinates and colors
- Creation of links between areas with configurable capacities
- Loading of area load data from feather files
- Integration with Antares API for study creation
To reformat your code, use this command line:
ruff check src/ tests/ --fix && ruff format src/ tests/To typecheck your code, use this command line:
mypyTo use tox to run unit tests in multiple python versions at the same time as linting and formatting with ruff and typing with mypy:
- As the dev requirements include uv and
tox-uvthere is no need to install python versions,uvwill do this for you. - Use
tox -pto run the environments in parallel to save time, this will create virtual environment with the necessary python versions the first time you run tox.
This project is licensed under the Mozilla Public License 2.0 - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
See AUTHORS.txt for a list of contributors.