Skip to main content

Antares Craft

CI Quality Gate Status Coverage License PyPI Latest Release

What is it ?

Antares Craft is a python library to read and edit antares-simulator studies, stored either on you local filesystem or on an antares-web server. It also allows you to trigger simulations and retrieve the corresponding result.

Main features

  • Read and edit antares-simulator studies programmatically
  • Work seamlessly on filesystem or antares-web studies
  • Support for variant studies on antares-web
  • Launch simulations, be it on you computer or on antares-web server
  • Retrieve and inspect simulation outputs
  • Generate availability timeseries, be it on you computer or on antares-web server

Installation

Antares Craft can simply be installed from PyPI repository, typically using pip:

pip install antares_craft

Documentation

Example

Below as an example, a code snippet where we create a small study with only one area where 100 MW of load are fed with a cluster of 5 power plants of 30 MW each. We then run the simulation and print some results.

For more information and examples please refer to the documentation.

conf = APIconf(api_host="https://antares-web.mydomain", token="my-token", verify=True)

# create a study named "my-study" on the antares-web server
study = create_study_api(study_name="my-study", version="8.8", api_config=conf)

# create an area with 100 MW of load for every hour of the year, and 3000 euros/h for unsupplied energy cost
area = study.create_area(area_name="my-country", properties=AreaProperties(energy_cost_unsupplied=3000))
area.set_load(pd.DataFrame(data=100 * np.ones((8760, 1))))

# create a cluster with 5 nuclear units of 30 MW each, and a generation cost of 30 MW/h
cluster = area.create_thermal_cluster("nuclear",
                                      ThermalClusterProperties(unit_count=5,
                                                               nominal_capacity=30,
                                                               marginal_cost=10,
                                                               market_bid_cost=10,
                                                               group=ThermalClusterGroup.NUCLEAR))
cluster.set_series(pd.DataFrame(data=150 * np.ones((8760, 1))))

# launch a simulation on the server and wait for the result
job = study.run_antares_simulation()
study.wait_job_completion(job)
output = study.get_output(job.output_id)

# read some output data as a pandas dataframe:
res = output.aggregate_mc_all_areas(data_type=MCAllAreasDataType.DETAILS, frequency=Frequency.HOURLY)
print(res)

should print the following output, which shows that at every hour the created cluster has generated 100 MW as expected to feed the load, and had to start 4 units (NODU column).

            area  cluster  timeId  production  NP Cost  NODU  Profit - Euro
0     my-country  nuclear       1       100.0      0.0   4.0            0.0
1     my-country  nuclear       2       100.0      0.0   4.0            0.0
2     my-country  nuclear       3       100.0      0.0   4.0            0.0
3     my-country  nuclear       4       100.0      0.0   4.0            0.0
4     my-country  nuclear       5       100.0      0.0   4.0            0.0
...          ...      ...     ...         ...      ...   ...            ...
8731  my-country  nuclear    8732       100.0      0.0   4.0            0.0
8732  my-country  nuclear    8733       100.0      0.0   4.0            0.0
8733  my-country  nuclear    8734       100.0      0.0   4.0            0.0
8734  my-country  nuclear    8735       100.0      0.0   4.0            0.0
8735  my-country  nuclear    8736       100.0      0.0   4.0            0.0

[8736 rows x 7 columns]

Metadata

Release files for antares-craft 0.20.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for antares-craft 0.20.0
File Size Uploaded Provenance Actions
antares_craft-0.20.0.tar.gz 177.0 kB Without provenance Details for antares_craft-0.20.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for antares-craft 0.20.0
File Interpreter ABI Platform Actions
antares_craft-0.20.0-py3-none-any.whl Python 3 none any Details for antares_craft-0.20.0-py3-none-any.whl

Total release size: 435.3 kB

Release files / antares_craft-0.20.0.tar.gz

Download URL antares_craft-0.20.0.tar.gz
Size 177.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6a35e758940f96939ef4ac78e820099bb72681ecbdd41b713efad2fb2cc49b18
BLAKE2b-256 checksum
How to use checksums
1baece0449875fdef897705a60529f33bbf72dfd21e9214bef279eba10b3452f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / antares_craft-0.20.0-py3-none-any.whl

Download URL antares_craft-0.20.0-py3-none-any.whl
Size 258.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
891332e593d4d110219860f2fe6d8426f92dba1f0505f8de038c8351c0e71754
BLAKE2b-256 checksum
How to use checksums
748acf30d2f22fee302f175d53dba1cdc26a1181f18a83f603f93f17390c5475
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for antares-craft 0.20.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.20.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page