Skip to content

output

Classes:

Frequency

Time span over which the results are assessed.

Attributes:

  • HOURLY

    Hourly detail.

  • DAILY

    Daily bundle.

  • WEEKLY

    Weekly bundle.

  • MONTHLY

    Monthly bundle.

  • ANNUAL

    Annual bundle.

MCAllAreasDataType

Type of synthetic output files generated by the simulation for each area.

Attributes:

  • VALUES

    General values of variables (price, load, generation, etc.). Files of this type have the same size for all areas. In the UI, it corresponds to displaying General values.

  • DETAILS

    Values regarding dispatchable thermal generating plants. File sizes differ by area. In the UI, it corresponds to displaying Thermal plants.

  • DETAILS_ST_STORAGE

    Values regarding the different short-term storages of each area. The sizes of these files differ from one area to another. In the UI, it corresponds to displaying ST storages.

  • DETAILS_RES

    Values regarding the different renewable clusters of each area. The sizes of these files differ from one area to another. In the UI, it corresponds to displaying Ren. clusters.

  • ID

    Identifier (number) of the Monte-Carlo years for which were observed the extreme values of the different variables presented in the values files. In the UI, it corresponds to displaying RecordYear.

MCAllLinksDataType

Type of synthetic output files generated by the simulation for each area.

Attributes:

  • VALUES

    values of different variables (flow, congestion rent) the list of which is common to all interconnections. The files of type values have therefore the same size everywhere. In the UI, it corresponds to displaying General values.

  • ID

    Identifier (number) of the Monte-Carlo years for which were observed the extreme values of the different variables presented in the values files. In the UI, it corresponds to displaying RecordYear.

MCIndAreasDataType

Type of files generated by the simulation for each area and each Monte-Carlo year.

Attributes:

  • VALUES

    General values of variables (price, load, generation, etc.). Files of this type have the same size for all areas. In the UI, it corresponds to displaying General values.

  • DETAILS

    Values regarding dispatchable thermal generating plants. File sizes differ by area. In the UI, it corresponds to displaying Thermal plants.

  • DETAILS_ST_STORAGE

    Values regarding the different short-term storages of each area. The sizes of these files differ from one area to another. In the UI, it corresponds to displaying ST storages.

  • DETAILS_RES

    Values regarding the different renewable clusters of each area. The sizes of these files differ from one area to another. In the UI, it corresponds to displaying Ren. clusters.

MCIndLinksDataType

Type of output files generated by the simulation for each link and each Monte-Carlo year.

Attributes:

  • VALUES

    values of different variables (flow, congestion rent) the list of which is common to all interconnections. The files of type values have therefore the same size everywhere. In the UI, it corresponds to displaying General values.

Output

Output(name: str, archived: bool, output_service: BaseOutputService)

Output of an Antares Simulator simulation with or without Antares Xpansion.

See also the user documentation for more insights and explanations on outputs.

Methods:

Attributes:

Source code in src/antares/craft/model/output.py
def __init__(self, name: str, archived: bool, output_service: BaseOutputService):
    self._name = name
    self._archived = archived
    self._output_service: BaseOutputService = output_service

archived property

archived: bool

Whether the output is archived.

name property

name: str

Name of the output.

aggregate_mc_all_areas

aggregate_mc_all_areas(
    data_type: MCAllAreasDataType,
    frequency: Frequency,
    areas_ids: Optional[list[str]] = None,
    columns_names: Optional[list[str]] = None,
) -> DataFrame

Get an aggregation of synthetic results for specific areas.

Given the parameters, it will aggregate data from files such as: mc-all/<mc_year>/areas/<area>/<data_type>-<frequency> generated by Antares Simulator.

Parameters:

  • data_type

    (MCAllAreasDataType) –

    Whether "VALUES", "DETAILS", "DETAILS_ST_STORAGE", "DETAILS_RES" or "ID", corresponding to the nature of the result.

  • frequency

    (Frequency) –

    Whether "HOURLY", "DAILY", "WEEKLY", "MONTHLY", "ANNUAL", corresponding to the time step between each values in the output.

  • areas_ids

    (Optional[list[str]], default: None ) –

    List of area IDs to fetch. If not indicated, all area IDs are aggregated.

  • columns_names

    (Optional[list[str]], default: None ) –

    List of the column names to fetch (apart from those automatically generated by the aggregation see below). If not indicated, all columns are taken into account for the aggregation.

Returns:

  • DataFrame

    A dataframe aggregating all the data.

    It contains at least the columns: area, timeId and cluster if the data_type is set to "DETAILS", "DETAILS_RES" or "DETAILS_ST_STORAGES".

    Those results are not multi indexed columns, the statistical metrics is appended to the column name such as "EXP", "STD", "MAX" and "MIN".

Source code in src/antares/craft/model/output.py
def aggregate_mc_all_areas(
    self,
    data_type: MCAllAreasDataType,
    frequency: Frequency,
    areas_ids: Optional[list[str]] = None,
    columns_names: Optional[list[str]] = None,
) -> pd.DataFrame:
    """Get an aggregation of synthetic results for specific areas.

    Given the parameters, it will aggregate data from files such as:
    `mc-all/<mc_year>/areas/<area>/<data_type>-<frequency>`
    generated by Antares Simulator.

    Args:
        data_type: Whether "VALUES", "DETAILS", "DETAILS_ST_STORAGE", "DETAILS_RES"
            or "ID", corresponding to the nature of the result.
        frequency: Whether "HOURLY", "DAILY", "WEEKLY", "MONTHLY", "ANNUAL",
            corresponding to the time step between each values in the output.
        areas_ids: List of area IDs to fetch.
            If not indicated, all area IDs are aggregated.
        columns_names: List of the column names to fetch
            (apart from those automatically generated by the aggregation see below).
            If not indicated, all columns are taken into account for the aggregation.

    Returns:
        A dataframe aggregating all the data.

            It contains at least the columns:
            `area`, `timeId` and `cluster` if the `data_type` is set to
            "DETAILS", "DETAILS_RES" or "DETAILS_ST_STORAGES".

            Those results are not multi indexed columns, the statistical metrics is appended to
            the column name such as "EXP", "STD", "MAX" and "MIN".
    """
    aggregation_entry = AggregationEntry(
        data_type=data_type,
        frequency=frequency,
        type_ids=areas_ids,
        columns_names=columns_names,
    )

    return self._output_service.aggregate_values(self.name, aggregation_entry, "areas", "all")
aggregate_mc_all_links(
    data_type: MCAllLinksDataType,
    frequency: Frequency,
    links_ids: Optional[list[tuple[str, str]]] = None,
    columns_names: Optional[list[str]] = None,
) -> DataFrame

Get an aggregation of synthetic results for specific links.

Given the parameters, it will aggregate data from files such as: mc-all/<mc_year>/links/<area_from> - <area_to>/<data_type>-<frequency> generated by Antares Simulator.

Parameters:

  • data_type

    (MCAllLinksDataType) –

    Whether "VALUES" or "ID", corresponding to the nature of the result.

  • frequency

    (Frequency) –

    Whether "HOURLY", "DAILY", "WEEKLY", "MONTHLY" or "ANNUAL", corresponding to the time step between each values in the output.

  • (Optional[list[tuple[str, str]]], default: None ) –

    List of tuples ("area_from", "area_to") to fetch. If not indicated, all link IDs are aggregated.

  • columns_names

    (Optional[list[str]], default: None ) –

    List of the column names to fetch (apart from those automatically generated by the aggregation see below). If not indicated, all columns are taken into account for the aggregation.

Returns:

  • DataFrame

    A dataframe aggregating all the data with at least the columns: link and timeId.

    Those results are not multi indexed columns, the statistical metrics is appended to the column name such as "EXP", "STD", "MAX" and "MIN".

Source code in src/antares/craft/model/output.py
def aggregate_mc_all_links(
    self,
    data_type: MCAllLinksDataType,
    frequency: Frequency,
    links_ids: Optional[list[tuple[str, str]]] = None,
    columns_names: Optional[list[str]] = None,
) -> pd.DataFrame:
    """Get an aggregation of synthetic results for specific links.

    Given the parameters, it will aggregate data from files such as:
    `mc-all/<mc_year>/links/<area_from> - <area_to>/<data_type>-<frequency>`
    generated by Antares Simulator.

    Args:
        data_type: Whether "VALUES" or "ID", corresponding to the nature of the result.
        frequency: Whether "HOURLY", "DAILY", "WEEKLY", "MONTHLY" or "ANNUAL",
            corresponding to the time step between each values in the output.
        links_ids: List of tuples ("area_from", "area_to") to fetch.
            If not indicated, all link IDs are aggregated.
        columns_names: List of the column names to fetch
            (apart from those automatically generated by the aggregation see below).
            If not indicated, all columns are taken into account for the aggregation.

    Returns:
        A dataframe aggregating all the data with at least the columns: `link` and `timeId`.

            Those results are not multi indexed columns, the statistical metrics is appended to
            the column name such as "EXP", "STD", "MAX" and "MIN".
    """
    type_ids = (
        [f"{area_from} - {area_to}" for link_id in links_ids for area_from, area_to in [sorted(link_id)]]
        if links_ids
        else None
    )

    aggregation_entry = AggregationEntry(
        data_type=data_type,
        frequency=frequency,
        type_ids=type_ids,
        columns_names=columns_names,
    )

    return self._output_service.aggregate_values(self.name, aggregation_entry, "links", "all")

aggregate_mc_ind_areas

aggregate_mc_ind_areas(
    data_type: MCIndAreasDataType,
    frequency: Frequency,
    mc_years: Optional[list[int]] = None,
    areas_ids: Optional[list[str]] = None,
    columns_names: Optional[list[str]] = None,
) -> DataFrame

Get an aggregation of individual results for specific areas.

Given the parameters, it will aggregate data from files such as: mc-ind/<mc_year>/areas/<area>/<data_type>-<frequency> generated by Antares Simulator.

Parameters:

  • data_type

    (MCIndAreasDataType) –

    Whether "VALUES", "DETAILS", "DETAILS_ST_STORAGE" or "DETAILS_RES", corresponding to the nature of the result.

  • frequency

    (Frequency) –

    Whether "HOURLY", "DAILY", "WEEKLY", "MONTHLY", "ANNUAL", corresponding to the time step between each values in the output.

  • mc_years

    (Optional[list[int]], default: None ) –

    List of the Monte-Carlo years index to fetch. If not indicated, all Monte-Carlo years are aggregated.

  • areas_ids

    (Optional[list[str]], default: None ) –

    List of the area IDs to fetch. If not indicated, all area IDs are aggregated.

  • columns_names

    (Optional[list[str]], default: None ) –

    List of the column names to fetch (apart from those automatically generated by the aggregation see below). If not indicated, all columns are taken in the aggregation.

Returns:

  • DataFrame

    A dataframe aggregating all the data with at least the columns: area, mcYear, timeId and cluster if data_type is not "VALUES".

Source code in src/antares/craft/model/output.py
def aggregate_mc_ind_areas(
    self,
    data_type: MCIndAreasDataType,
    frequency: Frequency,
    mc_years: Optional[list[int]] = None,
    areas_ids: Optional[list[str]] = None,
    columns_names: Optional[list[str]] = None,
) -> pd.DataFrame:
    """Get an aggregation of individual results for specific areas.

    Given the parameters, it will aggregate data from files such as:
    `mc-ind/<mc_year>/areas/<area>/<data_type>-<frequency>`
    generated by Antares Simulator.

    Args:
        data_type: Whether "VALUES", "DETAILS", "DETAILS_ST_STORAGE" or "DETAILS_RES",
            corresponding to the nature of the result.
        frequency: Whether "HOURLY", "DAILY", "WEEKLY", "MONTHLY", "ANNUAL",
            corresponding to the time step between each values in the output.
        mc_years: List of the Monte-Carlo years index to fetch.
            If not indicated, all Monte-Carlo years are aggregated.
        areas_ids: List of the area IDs to fetch.
            If not indicated, all area IDs are aggregated.
        columns_names: List of the column names to fetch
            (apart from those automatically generated by the aggregation see below).
            If not indicated, all columns are taken in the aggregation.

    Returns:
        A dataframe aggregating all the data with at least the columns:
            `area`, `mcYear`, `timeId` and `cluster` if `data_type` is not "VALUES".
    """
    aggregation_entry = AggregationEntry(
        data_type=data_type,
        frequency=frequency,
        mc_years=mc_years,
        type_ids=areas_ids,
        columns_names=columns_names,
    )

    return self._output_service.aggregate_values(self.name, aggregation_entry, "areas", "ind")
aggregate_mc_ind_links(
    data_type: MCIndLinksDataType,
    frequency: Frequency,
    mc_years: Optional[list[int]] = None,
    links_ids: Optional[list[tuple[str, str]]] = None,
    columns_names: Optional[list[str]] = None,
) -> DataFrame

Get an aggregation of individual results for specific links.

Given the parameters, it will aggregate data from files such as: mc-ind/<mc_year>/links/<area_from> - <area_to>/<data_type>-<frequency> generated by Antares Simulator.

Parameters:

  • data_type

    (MCIndLinksDataType) –

    Here the nature of the results can only be "VALUES".

  • frequency

    (Frequency) –

    Whether "HOURLY", "DAILY", "WEEKLY", "MONTHLY" or "ANNUAL", corresponding to the time step between each values in the output.

  • mc_years

    (Optional[list[int]], default: None ) –

    List of the Monte-Carlo years index to fetch. If not indicated, all Monte-Carlo years are aggregated.

  • (Optional[list[tuple[str, str]]], default: None ) –

    List of tuples ("area_from", "area_to") to fetch. If not indicated, all link IDs are aggregated.

  • columns_names

    (Optional[list[str]], default: None ) –

    List of the column names to fetch (apart from those automatically generated by the aggregation see below). If not indicated, all columns are taken into account for the aggregation.

Returns:

  • DataFrame

    A dataframe aggregating all the data with at least the columns: link, mcYear and timeId.

Source code in src/antares/craft/model/output.py
def aggregate_mc_ind_links(
    self,
    data_type: MCIndLinksDataType,
    frequency: Frequency,
    mc_years: Optional[list[int]] = None,
    links_ids: Optional[list[tuple[str, str]]] = None,
    columns_names: Optional[list[str]] = None,
) -> pd.DataFrame:
    """Get an aggregation of individual results for specific links.

    Given the parameters, it will aggregate data from files such as:
    `mc-ind/<mc_year>/links/<area_from> - <area_to>/<data_type>-<frequency>`
    generated by Antares Simulator.

    Args:
        data_type: Here the nature of the results can only be "VALUES".
        frequency: Whether "HOURLY", "DAILY", "WEEKLY", "MONTHLY" or "ANNUAL",
            corresponding to the time step between each values in the output.
        mc_years: List of the Monte-Carlo years index to fetch.
            If not indicated, all Monte-Carlo years are aggregated.
        links_ids: List of tuples ("area_from", "area_to") to fetch.
            If not indicated, all link IDs are aggregated.
        columns_names: List of the column names to fetch
            (apart from those automatically generated by the aggregation see below).
            If not indicated, all columns are taken into account for the aggregation.

    Returns:
        A dataframe aggregating all the data with at least the columns: `link`, `mcYear` and `timeId`.
    """
    type_ids = (
        [f"{area_from} - {area_to}" for link_id in links_ids for area_from, area_to in [sorted(link_id)]]
        if links_ids
        else None
    )

    aggregation_entry = AggregationEntry(
        data_type=data_type,
        frequency=frequency,
        mc_years=mc_years,
        type_ids=type_ids,
        columns_names=columns_names,
    )

    return self._output_service.aggregate_values(self.name, aggregation_entry, "links", "ind")

get_binding_constraint_ts_numbers

get_binding_constraint_ts_numbers(group_id: str) -> dict[int, int]

Get binding constraint time series numbers for a given constraint group.

Returns:

  • dict[int, int]

    A mapping from the Monte-Carlo year to its selected time series

Source code in src/antares/craft/model/output.py
def get_binding_constraint_ts_numbers(self, group_id: str) -> dict[int, int]:
    """Get binding constraint time series numbers for a given constraint group.

    Returns:
        A mapping from the Monte-Carlo year to its selected time series
    """
    return self._output_service.get_binding_constraint_ts_numbers(group_id, self._name)

get_hydro_ts_numbers

get_hydro_ts_numbers(area_id: str) -> dict[int, int]

Get hydro time series numbers for a given area.

Returns:

  • dict[int, int]

    A mapping from the Monte-Carlo year to its selected time series

Source code in src/antares/craft/model/output.py
def get_hydro_ts_numbers(self, area_id: str) -> dict[int, int]:
    """Get hydro time series numbers for a given area.

    Returns:
        A mapping from the Monte-Carlo year to its selected time series
    """
    return self._output_service.get_hydro_ts_numbers(area_id, self._name)
get_link_ts_numbers(area_from: str, area_to: str) -> dict[int, int]

Get link time series numbers for a given link.

Returns:

  • dict[int, int]

    A mapping from the Monte-Carlo year to its selected time series

Source code in src/antares/craft/model/output.py
def get_link_ts_numbers(self, area_from: str, area_to: str) -> dict[int, int]:
    """Get link time series numbers for a given link.

    Returns:
        A mapping from the Monte-Carlo year to its selected time series
    """
    return self._output_service.get_link_ts_numbers(area_from, area_to, self._name)

get_load_ts_numbers

get_load_ts_numbers(area_id: str) -> dict[int, int]

Get load time series numbers for a given area.

Returns:

  • dict[int, int]

    A mapping from the Monte-Carlo year to its selected time series

Source code in src/antares/craft/model/output.py
def get_load_ts_numbers(self, area_id: str) -> dict[int, int]:
    """Get load time series numbers for a given area.

    Returns:
        A mapping from the Monte-Carlo year to its selected time series
    """
    return self._output_service.get_load_ts_numbers(area_id, self._name)

get_mc_all_area

get_mc_all_area(
    frequency: Frequency, data_type: MCAllAreasDataType, area: str
) -> DataFrame

Get synthetic output data from a simulation for a specific area.

It will collect data from the file: mc-all/areas/<area>/<data_type>-<frequency> generated by Antares Simulator.

Parameters:

  • frequency

    (Frequency) –

    Whether "HOURLY", "DAILY", "WEEKLY", "MONTHLY" or "ANNUAL", corresponding to the time step between each values in the output.

  • data_type

    (MCAllAreasDataType) –

    Whether "VALUES", "DETAILS", "DETAILS_ST_STORAGE", "DETAILS_RES", "ID", corresponding to the nature of the result.

  • area

    (str) –

    The area ID.

Returns:

  • DataFrame

    A dataframe with all the synthetic results for an area.

    The columns are multi-indexed with:

    • output name
    • unit
    • statistical metric ("EXP", "std", "min", "max")
Source code in src/antares/craft/model/output.py
def get_mc_all_area(self, frequency: Frequency, data_type: MCAllAreasDataType, area: str) -> pd.DataFrame:
    """Get synthetic output data from a simulation for a specific area.

    It will collect data from the file:
    `mc-all/areas/<area>/<data_type>-<frequency>`
    generated by Antares Simulator.

    Args:
        frequency: Whether "HOURLY", "DAILY", "WEEKLY", "MONTHLY" or "ANNUAL",
            corresponding to the time step between each values in the output.
        data_type: Whether "VALUES", "DETAILS", "DETAILS_ST_STORAGE", "DETAILS_RES",
            "ID", corresponding to the nature of the result.
        area: The area ID.

    Returns:
        A dataframe with all the synthetic results for an area.

            The columns are multi-indexed with:

            - output name
            - unit
            - statistical metric ("EXP", "std", "min", "max")
    """
    file_path = f"mc-all/areas/{area}/{data_type.value}-{frequency.value}"
    return self._output_service.get_matrix(self.name, file_path, frequency)
get_mc_all_link(
    frequency: Frequency, data_type: MCAllLinksDataType, area_from: str, area_to: str
) -> DataFrame

Get synthetic output data from a simulation for a specific link.

It will collect data from the file: mc-all/links/<area_from> - <area_to>/<data_type>-<frequency> generated by Antares Simulator.

Parameters:

  • frequency

    (Frequency) –

    Whether "HOURLY", "DAILY", "WEEKLY", "MONTHLY" or "ANNUAL", corresponding to the time step between each values in the output.

  • data_type

    (MCAllLinksDataType) –

    Whether "VALUES", "ID", corresponding to the nature of the result.

  • area_from

    (str) –

    Link starting point ID (first in alphabetical order).

  • area_to

    (str) –

    Link ending point ID (second in alphabetical order).

Returns:

  • DataFrame

    A dataframe with all the synthetic results for a link.

    The columns are multi-indexed with:

    • output name
    • unit
    • statistical metric ("EXP", "std", "min" or "max")
Source code in src/antares/craft/model/output.py
def get_mc_all_link(
    self, frequency: Frequency, data_type: MCAllLinksDataType, area_from: str, area_to: str
) -> pd.DataFrame:
    """Get synthetic output data from a simulation for a specific link.

    It will collect data from the file:
    `mc-all/links/<area_from> - <area_to>/<data_type>-<frequency>`
    generated by Antares Simulator.

    Args:
        frequency: Whether "HOURLY", "DAILY", "WEEKLY", "MONTHLY" or "ANNUAL",
            corresponding to the time step between each values in the output.
        data_type: Whether "VALUES", "ID", corresponding to the nature of the result.
        area_from: Link starting point ID (first in alphabetical order).
        area_to: Link ending point ID (second in alphabetical order).

    Returns:
        A dataframe with all the synthetic results for a link.

            The columns are multi-indexed with:

            - output name
            - unit
            - statistical metric ("EXP", "std", "min" or "max")
    """
    if [area_from, area_to] != sorted([area_from, area_to]):
        raise OutputDataRetrievalError(self.name, "Areas should be sorted alphabetically")
    file_path = f"mc-all/links/{area_from} - {area_to}/{data_type.value}-{frequency.value}"
    return self._output_service.get_matrix(self.name, file_path, frequency)

get_mc_ind_area

get_mc_ind_area(
    mc_year: int, frequency: Frequency, data_type: MCIndAreasDataType, area: str
) -> DataFrame

Get output data for a single Monte-Carlo year and a specific area.

It will collect data from the file: mc-ind/<mc_year>/areas/<area>/<data_type>-<frequency> generated by Antares Simulator.

Parameters:

  • mc_year

    (int) –

    Monte-Carlo year index.

  • frequency

    (Frequency) –

    Whether "HOURLY", "DAILY", "WEEKLY", "MONTHLY" or "ANNUAL", corresponding to the time step between each values in the output.

  • data_type

    (MCIndAreasDataType) –

    Whether "VALUES", "DETAILS", "DETAILS_ST_STORAGE", "DETAILS_RES", "ID", corresponding to the nature of the result.

  • area

    (str) –

    The area ID.

Returns:

  • DataFrame

    A dataframe with all the results for an individual Monte-Carlo year.

    The columns are multi-indexed with:

    • output name
    • unit

    For homogeneity with get_mc_all_<area/link> methods, there is actually a last index that is an empty string as there is no statistical metric applied on the column.

Source code in src/antares/craft/model/output.py
def get_mc_ind_area(
    self, mc_year: int, frequency: Frequency, data_type: MCIndAreasDataType, area: str
) -> pd.DataFrame:
    """Get output data for a single Monte-Carlo year and a specific area.

    It will collect data from the file:
    `mc-ind/<mc_year>/areas/<area>/<data_type>-<frequency>`
    generated by Antares Simulator.

    Args:
        mc_year: Monte-Carlo year index.
        frequency: Whether "HOURLY", "DAILY", "WEEKLY", "MONTHLY" or "ANNUAL",
            corresponding to the time step between each values in the output.
        data_type: Whether "VALUES", "DETAILS", "DETAILS_ST_STORAGE", "DETAILS_RES",
            "ID", corresponding to the nature of the result.
        area: The area ID.

    Returns:
        A dataframe with all the results for an individual Monte-Carlo year.

            The columns are multi-indexed with:

            - output name
            - unit

            For homogeneity with `get_mc_all_<area/link>` methods,
            there is actually a last index that is an empty string
            as there is no statistical metric applied on the column.
    """
    file_path = f"mc-ind/{mc_year:05}/areas/{area}/{data_type.value}-{frequency.value}"
    return self._output_service.get_matrix(self.name, file_path, frequency)
get_mc_ind_link(
    mc_year: int,
    frequency: Frequency,
    data_type: MCIndLinksDataType,
    area_from: str,
    area_to: str,
) -> DataFrame

Get output data for a single Monte-Carlo year and a specific link.

It will collect data from the file: mc-ind/<mc_year>/links/<area_from> - <area_to>/<data_type>-<frequency> generated by Antares Simulator.

Parameters:

  • mc_year

    (int) –

    Monte-Carlo year index.

  • frequency

    (Frequency) –

    Whether "HOURLY", "DAILY", "WEEKLY", "MONTHLY" or "ANNUAL", corresponding to the time step between each values in the output.

  • data_type

    (MCIndLinksDataType) –

    Only possibility for the nature of the results which is "VALUES".

  • area_from

    (str) –

    Link starting point ID (first in alphabetical order).

  • area_to

    (str) –

    Link ending point ID (second in alphabetical order).

Returns:

  • DataFrame

    A dataframe with all the results for an individual Monte-Carlo year.

    The columns are multi-indexed with:

    • output name
    • unit

    For homogeneity with get_mc_all_<area/link> methods, there is actually a last index that is an empty string as there is no statistical metric applied on the column.

Source code in src/antares/craft/model/output.py
def get_mc_ind_link(
    self, mc_year: int, frequency: Frequency, data_type: MCIndLinksDataType, area_from: str, area_to: str
) -> pd.DataFrame:
    """Get output data for a single Monte-Carlo year and a specific link.

    It will collect data from the file:
    `mc-ind/<mc_year>/links/<area_from> - <area_to>/<data_type>-<frequency>`
    generated by Antares Simulator.

    Args:
        mc_year: Monte-Carlo year index.
        frequency: Whether "HOURLY", "DAILY", "WEEKLY", "MONTHLY" or "ANNUAL",
            corresponding to the time step between each values in the output.
        data_type: Only possibility for the nature of the results which is "VALUES".
        area_from: Link starting point ID (first in alphabetical order).
        area_to: Link ending point ID (second in alphabetical order).

    Returns:
        A dataframe with all the results for an individual Monte-Carlo year.

            The columns are multi-indexed with:

            - output name
            - unit

            For homogeneity with `get_mc_all_<area/link>` methods,
            there is actually a last index that is an empty string
            as there is no statistical metric applied on the column.
    """
    if [area_from, area_to] != sorted([area_from, area_to]):
        raise OutputDataRetrievalError(self.name, "Areas should be sorted alphabetically")
    file_path = f"mc-ind/{mc_year:05}/links/{area_from} - {area_to}/{data_type.value}-{frequency.value}"
    return self._output_service.get_matrix(self.name, file_path, frequency)

get_solar_ts_numbers

get_solar_ts_numbers(area_id: str) -> dict[int, int]

Get solar time series numbers.

Returns:

  • dict[int, int]

    A mapping from the Monte-Carlo year to its selected time series

Source code in src/antares/craft/model/output.py
def get_solar_ts_numbers(self, area_id: str) -> dict[int, int]:
    """Get solar time series numbers.

    Returns:
        A mapping from the Monte-Carlo year to its selected time series
    """
    return self._output_service.get_solar_ts_numbers(area_id, self._name)

get_st_storage_additional_constraints_numbers

get_st_storage_additional_constraints_numbers(
    area_id: str, st_storage_id: str, constraint_id: str
) -> dict[int, int]

Get short-term storage additional constraints time series numbers for a given constraint.

Returns:

  • dict[int, int]

    A mapping from the Monte-Carlo year to its selected time series

Source code in src/antares/craft/model/output.py
def get_st_storage_additional_constraints_numbers(
    self, area_id: str, st_storage_id: str, constraint_id: str
) -> dict[int, int]:
    """Get short-term storage additional constraints time series numbers for a given constraint.

    Returns:
        A mapping from the Monte-Carlo year to its selected time series
    """
    return self._output_service.get_st_storage_additional_constraints_numbers(
        area_id, st_storage_id, constraint_id, self._name
    )

get_st_storage_inflows_numbers

get_st_storage_inflows_numbers(area_id: str, st_storage_id: str) -> dict[int, int]

Get short-term storage inflows time series numbers for a given st-storage.

Returns:

  • dict[int, int]

    A mapping from the Monte-Carlo year to its selected time series

Source code in src/antares/craft/model/output.py
def get_st_storage_inflows_numbers(self, area_id: str, st_storage_id: str) -> dict[int, int]:
    """Get short-term storage inflows time series numbers for a given st-storage.

    Returns:
        A mapping from the Monte-Carlo year to its selected time series
    """
    return self._output_service.get_st_storage_inflows_numbers(area_id, st_storage_id, self._name)

get_thermal_ts_numbers

get_thermal_ts_numbers(area_id: str, thermal_id: str) -> dict[int, int]

Get thermal time series numbers for a given thermal cluster.

Returns:

  • dict[int, int]

    A mapping from the Monte-Carlo year to its selected time series

Source code in src/antares/craft/model/output.py
def get_thermal_ts_numbers(self, area_id: str, thermal_id: str) -> dict[int, int]:
    """Get thermal time series numbers for a given thermal cluster.

    Returns:
        A mapping from the Monte-Carlo year to its selected time series
    """
    return self._output_service.get_thermal_ts_numbers(area_id, thermal_id, self._name)

get_wind_ts_numbers

get_wind_ts_numbers(area_id: str) -> dict[int, int]

Get wind time series numbers for a given area.

Returns:

  • dict[int, int]

    A mapping from the Monte-Carlo year to its selected time series

Source code in src/antares/craft/model/output.py
def get_wind_ts_numbers(self, area_id: str) -> dict[int, int]:
    """Get wind time series numbers for a given area.

    Returns:
        A mapping from the Monte-Carlo year to its selected time series
    """
    return self._output_service.get_wind_ts_numbers(area_id, self._name)

get_xpansion_result

get_xpansion_result() -> XpansionResult

Get xpansion result.

Returns:

Source code in src/antares/craft/model/output.py
def get_xpansion_result(self) -> XpansionResult:
    """Get xpansion result.

    Returns:
        Xpansion results.
    """
    return self._output_service.get_xpansion_result(self.name)

get_xpansion_sensitivity_result

get_xpansion_sensitivity_result() -> XpansionSensitivityResult

Get xpansion sensitivity results.

Returns:

Source code in src/antares/craft/model/output.py
def get_xpansion_sensitivity_result(self) -> XpansionSensitivityResult:
    """Get xpansion sensitivity results.

    Returns:
        Xpansion sensitivity results.
    """
    return self._output_service.get_xpansion_sensitivity_result(self.name)

XpansionOutputAntares dataclass

XpansionOutputAntares(version: str)

Output of Xpansion investment module.

Attributes:

  • version (str) –

    The version of the module used in the simulation.

XpansionOutputCandidate dataclass

XpansionOutputCandidate(
    solution: float,
    max: float,
    min: float,
    iterations: list[XpansionOutputCandidateInvest],
)

Xpansion output candidate.

Attributes:

  • solution (float) –

    Invested capacity at the end of the algorithm.

  • max (float) –

    Maximum possible investment (in MW).

  • min (float) –

    Minimum possible investment (in MW).

  • iterations (list[XpansionOutputCandidateInvest]) –

    List of the output candidate investment for each iteration.

XpansionOutputCandidateInvest dataclass

XpansionOutputCandidateInvest(invest: float)

Xpansion output candidate investment.

Attributes:

  • invest (float) –

    Amount of investment for a given candidate.

XpansionOutputCandidateSensitivity dataclass

XpansionOutputCandidateSensitivity(
    lb: float,
    ub: float,
    solution_max: XpansionOutputCandidateInvest,
    solution_min: XpansionOutputCandidateInvest,
)

Xpansion output candidate sensitivity study.

Attributes:

XpansionOutputIteration dataclass

XpansionOutputIteration(
    best_ub: float,
    cumulative_number_of_subproblem_resolutions: int,
    investment_cost: float,
    lb: float,
    master_duration: float,
    operational_cost: float,
    optimality_gap: float,
    overall_cost: float,
    relative_gap: float,
    subproblem_duration: float,
    ub: float,
)

Xpansion output for a given iteration.

Attributes:

  • best_ub (float) –

    Best upper bound on the optimal cost.

  • cumulative_number_of_subproblem_resolutions (int) –

    Cumulative number of subproblems solved from the beginning of the Benders algorithm.

  • investment_cost (float) –

    Investment cost of the solution at the current iteration.

  • lb (float) –

    Lower bound on the optimal cost: this is the solution of the master problem as it is a relaxation of the investment problem.

  • master_duration (float) –

    Duration of the master problem resolution.

  • operational_cost (float) –

    Expectation of the yearly operational cost over all MC years of the linear relaxation of an Antares simulation for the system with the current iteration investment level.

  • optimality_gap (float) –

    Absolute gap between the lb and the best_ub ((best_ub - lb)).

  • overall_cost (float) –

    Sum of investment cost and operational_cost.

  • relative_gap (float) –

    At each iteration, the algorithm computes upper and lower bounds on the optimal cost. The algorithm stops as soon as the quantity (best_ub - lb) / max(|best_ub|, |lb|) falls below relative_gap. For a relative gap \(\alpha\), the cost of the solution returned by the algorithm satisfies: $\(\frac{{\scriptstyle\texttt{xpansion solution cost}} - {\scriptstyle\texttt{optimal cost}}}{{\scriptstyle\texttt{optimal cost}}} < \alpha\)$.

  • subproblem_duration (float) –

    Wall time for the resolution of all weekly Antares subproblems at the current iteration.

  • ub (float) –

    Overall cost of the solution of the current iteration. This may be greater than best_ub if a previous iteration led to a better solution.

XpansionOutputOptions dataclass

XpansionOutputOptions(
    log_level: int, master_name: str, problem_format: str, solver_name: str
)

Options of Xpansion output.

Attributes:

  • log_level (int) –

    Solver's log severity in {0, 1, 2}.

  • master_name (str) –

    Name of the master problem file (automatically generated).

  • problem_format (str) –
    • MPS: Problems in MPS text format.
    • OPTIMIZED: Problems in binary SVF format.
  • solver_name (str) –

    Solver used for the resolution of the optimization problem.

XpansionOutputSensitivitySolution dataclass

XpansionOutputSensitivitySolution(
    objective: float, problem_type: str, status: int, system_cost: float
)

Xpansion output sensitivity solution.

Attributes:

  • objective (float) –

    Objective value of the solution of the sensitivity analysis.

  • problem_type (str) –
    • "capex": Find a near-optimal solution with min or max capex.
    • "investment ": Find a near-optimal solution that minimizes or maximizes the investment for a given asset.
  • status (int) –

    Problem status.

  • system_cost (float) –

    System cost with the solution of the sensitivity analysis.

XpansionOutputSolution dataclass

XpansionOutputSolution(
    investment_cost: float,
    iteration: int,
    operational_cost: float,
    optimality_gap: float,
    overall_cost: float,
    problem_status: str,
    relative_gap: float,
    stopping_criterion: str,
)

Xpansion output solution.

Attributes:

  • investment_cost (float) –

    Optimal investment cost found by the algorithm.

  • iteration (int) –

    Corresponding iteration for the best solution.

  • operational_cost (float) –

    Expectation of the yearly operational cost over all MC years of the linear relaxation of an Antares simulation for the system with the best investment.

  • optimality_gap (float) –

    Absolute gap between the lb and the best_ub ((best_ub - lb)).

  • overall_cost (float) –

    Sum of investment cost and operational_cost.

  • problem_status (str) –

    Problem status.

  • relative_gap (float) –

    At each iteration, the algorithm computes upper and lower bounds on the optimal cost. The algorithm stops as soon as the quantity (best_ub - lb) / max(|best_ub|, |lb|) falls below relative_gap. For a relative gap \(\alpha\), the cost of the solution returned by the algorithm satisfies: $\(\frac{{\scriptstyle\texttt{xpansion solution cost}} - {\scriptstyle\texttt{optimal cost}}}{{\scriptstyle\texttt{optimal cost}}} < \alpha\)$.

  • stopping_criterion (str) –

    Stopping criterion for the optimization problem.

XpansionResult dataclass

XpansionResult(
    antares: XpansionOutputAntares,
    antares_xpansion: XpansionOutputAntares,
    begin: datetime,
    end: datetime,
    iterations: dict[int, XpansionOutputIteration],
    nb_weeks: int,
    options: XpansionOutputOptions,
    run_duration: float,
    solution: XpansionOutputSolution,
    candidates: dict[str, XpansionOutputCandidate],
)

Xpansion results.

Attributes:

XpansionSensitivityResult dataclass

XpansionSensitivityResult(
    antares: XpansionOutputAntares,
    antares_xpansion: XpansionOutputAntares,
    best_benders_cost: float,
    epsilon: float,
    candidates: dict[str, XpansionOutputCandidateSensitivity],
    solution_max: XpansionOutputSensitivitySolution,
    solution_min: XpansionOutputSensitivitySolution,
)

Xpansion sensitivity results.

Attributes: