Skip to content

area

The Area model defines the description of the electrical demand (load), generation fleet (clusters).

Classes:

AdequacyPatchMode

Adequacy patch mode to fix the sharing of Energy not Served (ENS) between market areas.

  • outside: The area is a physical area not included in the adequacy patch domain
  • inside: The area is a physical area included in the adequacy patch domain
  • virtual: The area is a virtual area

Only available if study version >= 830.

Area

Area(
    name: str,
    area_service: BaseAreaService,
    storage_service: BaseShortTermStorageService,
    thermal_service: BaseThermalService,
    renewable_service: BaseRenewableService,
    hydro_service: BaseHydroService,
    *,
    renewables: Optional[dict[str, RenewableCluster]] = None,
    thermals: Optional[dict[str, ThermalCluster]] = None,
    st_storages: Optional[dict[str, STStorage]] = None,
    hydro: Optional[Hydro] = None,
    properties: Optional[AreaProperties] = None,
    ui: Optional[AreaUi] = None,
)

Represents an area of the study.

Provides access to data associated with that area, and to objects that are connected to it, for example thermal clusters, renewable clusters, binding constraints, etc.

Methods:

Attributes:

Source code in src/antares/craft/model/area.py
def __init__(
    self,
    name: str,
    area_service: BaseAreaService,
    storage_service: BaseShortTermStorageService,
    thermal_service: BaseThermalService,
    renewable_service: BaseRenewableService,
    hydro_service: BaseHydroService,
    *,
    renewables: Optional[dict[str, RenewableCluster]] = None,
    thermals: Optional[dict[str, ThermalCluster]] = None,
    st_storages: Optional[dict[str, STStorage]] = None,
    hydro: Optional[Hydro] = None,
    properties: Optional[AreaProperties] = None,
    ui: Optional[AreaUi] = None,
):
    self._name = name
    self._id = transform_name_to_id(name)
    self._area_service = area_service
    self._storage_service = storage_service
    self._thermal_service = thermal_service
    self._renewable_service = renewable_service
    self._hydro_service = hydro_service
    self._renewables = renewables or {}
    self._thermals = thermals or {}
    self._st_storages = st_storages or {}
    self._hydro = hydro or Hydro(self._hydro_service, self._id, HydroProperties(), InflowStructure(), [])
    self._properties = properties or AreaProperties()
    self._ui = ui or AreaUi()

hydro property

hydro: Hydro

Hydro properties of this area.

id property

id: str

The ID of this area.

name property

name: str

The name of this area.

properties property

properties: AreaProperties

Properties of this area.

ui property

ui: AreaUi

UI (display) properties of this area.

create_renewable_cluster

Creates a new renewable cluster in the current area.

Parameters:

Returns:

Source code in src/antares/craft/model/area.py
def create_renewable_cluster(
    self, renewable_name: str, properties: Optional[RenewableClusterProperties] = None
) -> RenewableCluster:
    """Creates a new renewable cluster in the current area.

    Args:
        renewable_name: The name of the new renewable cluster.
        properties: The properties of the new renewable cluster.

    Returns:
        The newly created renewable cluster.
    """
    renewable = self._area_service.create_renewable_cluster(self.id, renewable_name, properties)
    self._renewables[renewable.id] = renewable
    return renewable

create_st_storage

Creates a new short term storage in this area.

Parameters:

  • st_storage_name

    (str) –

    The name of the new short term storage.

  • properties

    (Optional[STStorageProperties], default: None ) –

    The properties of the new short term storage.

Returns:

  • STStorage

    The newly created short term storage.

Source code in src/antares/craft/model/area.py
def create_st_storage(self, st_storage_name: str, properties: Optional[STStorageProperties] = None) -> STStorage:
    """Creates a new short term storage in this area.

    Args:
        st_storage_name: The name of the new short term storage.
        properties: The properties of the new short term storage.

    Returns:
        The newly created short term storage.
    """
    storage = self._area_service.create_st_storage(self.id, st_storage_name, properties)
    self._st_storages[storage.id] = storage

    return storage

create_thermal_cluster

Creates a new thermal cluster in the current area.

Parameters:

Returns:

Source code in src/antares/craft/model/area.py
def create_thermal_cluster(
    self, thermal_name: str, properties: Optional[ThermalClusterProperties] = None
) -> ThermalCluster:
    """Creates a new thermal cluster in the current area.

    Args:
        thermal_name: The name of the new thermal cluster.
        properties: The properties of the new thermal cluster.

    Returns:
        The newly created thermal cluster.
    """
    thermal = self._area_service.create_thermal_cluster(self.id, thermal_name, properties)
    self._thermals[thermal.id] = thermal
    return thermal

delete_renewable_cluster

delete_renewable_cluster(renewable_cluster: RenewableCluster) -> None

Delete a single renewable cluster in this area.

Parameters:

Source code in src/antares/craft/model/area.py
def delete_renewable_cluster(self, renewable_cluster: RenewableCluster) -> None:
    """Delete a single renewable cluster in this area.

    Args:
        renewable_cluster: The renewable cluster to delete
    """
    self.delete_renewable_clusters([renewable_cluster])

delete_renewable_clusters

delete_renewable_clusters(renewable_clusters: list[RenewableCluster]) -> None

Delete a list of renewable clusters in this area.

Parameters:

Source code in src/antares/craft/model/area.py
def delete_renewable_clusters(self, renewable_clusters: list[RenewableCluster]) -> None:
    """Delete a list of renewable clusters in this area.

    Args:
        renewable_clusters: The list of renewable clusters to delete
    """
    # Checks deletion is possible
    bad_cluster_ids = []
    for cluster in renewable_clusters:
        if cluster.id not in self._renewables:
            bad_cluster_ids.append(cluster.id)
    if bad_cluster_ids:
        raise RenewableDeletionError(self.id, bad_cluster_ids, DELETION_ERROR_MSG)
    # Performs deletion
    self._area_service.delete_renewable_clusters(self.id, renewable_clusters)
    for cluster in renewable_clusters:
        self._renewables.pop(cluster.id)

delete_st_storage

delete_st_storage(storage: STStorage) -> None

Delete a short-term storage in this area.

Parameters:

  • storage

    (STStorage) –

    The short-term storage to delete

Source code in src/antares/craft/model/area.py
def delete_st_storage(self, storage: STStorage) -> None:
    """Delete a short-term storage in this area.

    Args:
        storage: The short-term storage to delete
    """
    self.delete_st_storages([storage])

delete_st_storages

delete_st_storages(storages: list[STStorage]) -> None

Delete a list of short-term storages in this area.

Parameters:

  • storages

    (list[STStorage]) –

    The list of short-term storage to delete

Source code in src/antares/craft/model/area.py
def delete_st_storages(self, storages: list[STStorage]) -> None:
    """Delete a list of short-term storages in this area.

    Args:
        storages: The list of short-term storage to delete
    """
    # Checks deletion is possible
    bad_cluster_ids = []
    for cluster in storages:
        if cluster.id not in self._st_storages:
            bad_cluster_ids.append(cluster.id)
    if bad_cluster_ids:
        raise STStorageDeletionError(self.id, bad_cluster_ids, DELETION_ERROR_MSG)
    # Performs deletion
    self._area_service.delete_st_storages(self.id, storages)
    for storage in storages:
        self._st_storages.pop(storage.id)

delete_thermal_cluster

delete_thermal_cluster(thermal_cluster: ThermalCluster) -> None

Delete a single thermal cluster in this area.

Parameters:

Source code in src/antares/craft/model/area.py
def delete_thermal_cluster(self, thermal_cluster: ThermalCluster) -> None:
    """Delete a single thermal cluster in this area.

    Args:
        thermal_cluster: A thermal cluster
    """
    self.delete_thermal_clusters([thermal_cluster])

delete_thermal_clusters

delete_thermal_clusters(thermal_clusters: list[ThermalCluster]) -> None

Delete a list of thermal clusters in this area.

Parameters:

Source code in src/antares/craft/model/area.py
def delete_thermal_clusters(self, thermal_clusters: list[ThermalCluster]) -> None:
    """Delete a list of thermal clusters in this area.

    Args:
        thermal_clusters: The list of thermal clusters to delete
    """
    # Checks deletion is possible
    bad_cluster_ids = []
    for cluster in thermal_clusters:
        if cluster.id not in self._thermals:
            bad_cluster_ids.append(cluster.id)
    if bad_cluster_ids:
        raise ThermalDeletionError(self.id, bad_cluster_ids, DELETION_ERROR_MSG)
    # Performs deletion
    self._area_service.delete_thermal_clusters(self.id, thermal_clusters)
    for cluster in thermal_clusters:
        self._thermals.pop(cluster.id)

get_load_matrix

get_load_matrix() -> DataFrame

Get the load time-series for the area.

Returns:

  • DataFrame

    The load time-series.

Source code in src/antares/craft/model/area.py
def get_load_matrix(self) -> pd.DataFrame:
    """Get the load time-series for the area.

    Returns:
        The load time-series.
    """
    return self._area_service.get_load_matrix(self.id)

get_misc_gen_matrix

get_misc_gen_matrix() -> DataFrame

Get the miscellaneous generation time-series for the area.

Returns:

  • DataFrame

    The miscellaneous generation time-series.

Source code in src/antares/craft/model/area.py
def get_misc_gen_matrix(self) -> pd.DataFrame:
    """Get the miscellaneous generation time-series for the area.

    Returns:
        The miscellaneous generation time-series.
    """
    return self._area_service.get_misc_gen_matrix(self.id)

get_renewables

get_renewables() -> MappingProxyType[str, RenewableCluster]

Renewable clusters connected to this area.

Returns:

Source code in src/antares/craft/model/area.py
def get_renewables(self) -> MappingProxyType[str, RenewableCluster]:
    """Renewable clusters connected to this area.

    Returns:
        Renewable clusters connected to this area, as a mapping of cluster ID to cluster.
    """
    return MappingProxyType(self._renewables)

get_reserves_matrix

get_reserves_matrix() -> DataFrame

Get the reserves time-series for the area.

Returns:

  • DataFrame

    The reserves time-series.

Source code in src/antares/craft/model/area.py
def get_reserves_matrix(self) -> pd.DataFrame:
    """Get the reserves time-series for the area.

    Returns:
        The reserves time-series.
    """
    return self._area_service.get_reserves_matrix(self.id)

get_solar_matrix

get_solar_matrix() -> DataFrame

Get the solar time-series for the area.

Returns:

  • DataFrame

    The solar time-series.

Source code in src/antares/craft/model/area.py
def get_solar_matrix(self) -> pd.DataFrame:
    """Get the solar time-series for the area.

    Returns:
        The solar time-series.
    """
    return self._area_service.get_solar_matrix(self.id)

get_st_storages

get_st_storages() -> MappingProxyType[str, STStorage]

Short term storages connected to this area.

Returns:

Source code in src/antares/craft/model/area.py
def get_st_storages(self) -> MappingProxyType[str, STStorage]:
    """Short term storages connected to this area.

    Returns:
        Short term storages connected to this area, as a mapping of storage ID to storage.
    """
    return MappingProxyType(self._st_storages)

get_thermals

get_thermals() -> MappingProxyType[str, ThermalCluster]

Thermal clusters connected to this area.

Returns:

Source code in src/antares/craft/model/area.py
def get_thermals(self) -> MappingProxyType[str, ThermalCluster]:
    """Thermal clusters connected to this area.

    Returns:
        Thermal clusters connected to this area, as a mapping of cluster ID to cluster.
    """
    return MappingProxyType(self._thermals)

get_wind_matrix

get_wind_matrix() -> DataFrame

Get the wind time-series for the area.

Returns:

  • DataFrame

    The wind time-series.

Source code in src/antares/craft/model/area.py
def get_wind_matrix(self) -> pd.DataFrame:
    """Get the wind time-series for the area.

    Returns:
        The wind time-series.
    """
    return self._area_service.get_wind_matrix(self.id)

set_load

set_load(series: DataFrame) -> None

Set the load time-series for this area

Parameters:

  • series

    (DataFrame) –

    The time-series

Source code in src/antares/craft/model/area.py
def set_load(self, series: pd.DataFrame) -> None:
    """Set the load time-series for this area

    Args:
        series: The time-series
    """
    self._area_service.set_load(self.id, series)

set_misc_gen

set_misc_gen(series: DataFrame) -> None

Set the miscellaneous generation time-series for this area

Parameters:

  • series

    (DataFrame) –

    The time-series

Source code in src/antares/craft/model/area.py
def set_misc_gen(self, series: pd.DataFrame) -> None:
    """Set the miscellaneous generation time-series for this area

    Args:
        series: The time-series
    """
    self._area_service.set_misc_gen(self.id, series)

set_reserves

set_reserves(series: DataFrame) -> None

Set the reserves time-series for this area

Parameters:

  • series

    (DataFrame) –

    The time-series

Source code in src/antares/craft/model/area.py
def set_reserves(self, series: pd.DataFrame) -> None:
    """Set the reserves time-series for this area

    Args:
        series: The time-series
    """
    self._area_service.set_reserves(self.id, series)

set_solar

set_solar(series: DataFrame) -> None

Set the solar time-series for this area

Parameters:

  • series

    (DataFrame) –

    The time-series

Source code in src/antares/craft/model/area.py
def set_solar(self, series: pd.DataFrame) -> None:
    """Set the solar time-series for this area

    Args:
        series: The time-series
    """
    self._area_service.set_solar(self.id, series)

set_wind

set_wind(series: DataFrame) -> None

Set the wind time-series for this area

Parameters:

  • series

    (DataFrame) –

    The time-series

Source code in src/antares/craft/model/area.py
def set_wind(self, series: pd.DataFrame) -> None:
    """Set the wind time-series for this area

    Args:
        series: The time-series
    """
    self._area_service.set_wind(self.id, series)

AreaProperties dataclass

AreaProperties(
    energy_cost_unsupplied: float = 0.0,
    energy_cost_spilled: float = 0.0,
    non_dispatch_power: bool = True,
    dispatch_hydro_power: bool = True,
    other_dispatch_power: bool = True,
    filter_synthesis: set[FilterOption] = (lambda: FILTER_VALUES)(),
    filter_by_year: set[FilterOption] = (lambda: FILTER_VALUES)(),
    adequacy_patch_mode: AdequacyPatchMode = OUTSIDE,
    spread_unsupplied_energy_cost: float = 0.0,
    spread_spilled_energy_cost: float = 0.0,
)

Represents all the properties for an area.

Attributes:

  • energy_cost_unsupplied (float) –

    Cost of unsupplied energy, in €/MWh.

  • energy_cost_spilled (float) –

    Cost of spilled energy, in €/MWh.

  • non_dispatch_power (bool) –

    Whether non-dispatchable power sources are enabled.

  • dispatch_hydro_power (bool) –

    Whether dispatchable hydro power is enabled.

  • other_dispatch_power (bool) –

    Whether other dispatchable power sources are enabled.

  • filter_synthesis (set[FilterOption]) –

    Set of filter options for synthesis (hourly, daily, weekly, monthly, annual).

  • filter_by_year (set[FilterOption]) –

    Set of filter options for output (hourly, daily, weekly, monthly, annual).

  • adequacy_patch_mode (AdequacyPatchMode) –

    Mode to include or not the area in adequacy patching.

  • spread_unsupplied_energy_cost (float) –

    Cost spread for unsupplied energy in €/MWh.

  • spread_spilled_energy_cost (float) –

    Cost spread for spilled energy in €/MWh.

AreaPropertiesUpdate dataclass

AreaPropertiesUpdate(
    energy_cost_unsupplied: Optional[float] = None,
    energy_cost_spilled: Optional[float] = None,
    non_dispatch_power: Optional[bool] = None,
    dispatch_hydro_power: Optional[bool] = None,
    other_dispatch_power: Optional[bool] = None,
    filter_synthesis: Optional[set[FilterOption]] = None,
    filter_by_year: Optional[set[FilterOption]] = None,
    adequacy_patch_mode: Optional[AdequacyPatchMode] = None,
    spread_unsupplied_energy_cost: Optional[float] = None,
    spread_spilled_energy_cost: Optional[float] = None,
)

Represents all the properties for an area.

Attributes:

  • energy_cost_unsupplied (Optional[float]) –

    Cost of unsupplied energy, in €/MWh.

  • energy_cost_spilled (Optional[float]) –

    Cost of spilled energy, in €/MWh.

  • non_dispatch_power (Optional[bool]) –

    Whether non-dispatchable power sources are enabled.

  • dispatch_hydro_power (Optional[bool]) –

    Whether dispatchable hydro power is enabled.

  • other_dispatch_power (Optional[bool]) –

    Whether other dispatchable power sources are enabled.

  • filter_synthesis (Optional[set[FilterOption]]) –

    Set of filter options for synthesis (hourly, daily, weekly, monthly, annual).

  • filter_by_year (Optional[set[FilterOption]]) –

    Set of filter options for output (hourly, daily, weekly, monthly, annual).

  • adequacy_patch_mode (Optional[AdequacyPatchMode]) –

    Mode to include or not the area in adequacy patching.

  • spread_unsupplied_energy_cost (Optional[float]) –

    Cost spread for unsupplied energy in €/MWh.

  • spread_spilled_energy_cost (Optional[float]) –

    Cost spread for spilled energy in €/MWh.

AreaUi dataclass

AreaUi(x: int = 0, y: int = 0, color_rgb: list[int] = (lambda: [230, 108, 44])())

Area UI properties.

Attributes:

  • x (int) –

    X position of the node

  • y (int) –

    Y position of the node

  • color_rgb (list[int]) –

    Color of the node in RGB format

AreaUiUpdate dataclass

AreaUiUpdate(
    x: Optional[int] = None,
    y: Optional[int] = None,
    color_rgb: Optional[list[int]] = None,
)

Update for area UI properties

Attributes: