Skip to content

Package Architecture

Preliminary notes on understanding antares_craft

The Antares Craft package is closely related to the Antares-Web interface, facilitating easy knowledge transfer. Parameter names follow the snake_case Python convention, so they are similar but not identical to those in .ini files or the interface. For example:

  • The number of Monte-Carlo years prepared for the simulation is referred to as nbyears in the generaldata.ini file and as nb_years in the GeneralParameters class.
  • The nominal injection capacity of a short-term storage is denoted as injection_nominal_capacity in the STStorageProperties class whereas it is called injectionnominalcapacity in the st-storage/list.ini file inside the file tree of the study on your computer.
  • The column name for the loss of load duration in the output files generated by the simulator is LOLD. In the code, it is referred to as lold.

The package uses an Object-Oriented Programming (OOP) architecture, grouping information into classes (named in CamelCase). These classes consist of:

  • Attributes: Store values, parameter strings, paths to files, or other classes.
  • Methods: Perform actions on the class or its attributes.

Several standalone functions are available for users:

When the UI includes dropdown menus with multiple choices, there is generally a corresponding enumeration (Enum) class. You can access options using . and the option name in uppercase, such as Enum.OPTION1.

To aggregate parameters, there are classes like XxxxProperties and XxxxPropertiesUpdate. The latter differs in that all parameter fields are optional. Note that not all classes are meant to be modified by the user, as some provide only default parameters.

Architecture overview

To better understand the package architecture, the following diagrams provide a visual representation. All classes and enums imported when using from antares_craft import * are included. The arrows indicate dependencies, but note that classes may also include numerical values, paths, or strings.

The diagrams relates also to the thematic organization of the API reference section of this documentation. You can find the complete diagrams by downloading the SVG.

Legend

Connection and main classes

The entry points of Antares are the configuration classes for either local or API configuration. The most important class is Study.

Note

To create a study, use the standalone functions instead of the Study class constructor. After creating a study, apply changes using the Study methods.

At the base of the modelization of an energy system in Antares are areas and links in between.

Xpansion

The Xpansion module allows to make some capacity investments on some candidates and also to make a sensitivity analysis.

Settings

The settings are divided roughly into two part.

  1. The settings for the simulation (simulator executable...):

  2. And the settings for the study:

Outputs

To analyze outputs from an Antares simulation, you need to use the get_output method of the study you are working on. This returns an Output object.

Binding constraints

The binding constraints allow to simulate thinks that are not modeled by default: Kirchoff's law, investment on clusters (it will be soon available natively)...