Skip to content

link

Classes:

  • AssetType

    Enumeration of the different types of link.

  • Link

    A link between two areas.

  • LinkProperties

    Properties of a link between two areas.

  • LinkPropertiesUpdate

    Update the properties of a link between two areas.

  • LinkStyle

    Enumeration of the different types styles of link in the UI.

  • LinkUi

    Visual appearance of the link in the UI.

  • LinkUiUpdate

    Update the visual appearance of the link in the UI.

  • TransmissionCapacities

    Enumeration of the transmission capacities.

AssetType

Enumeration of the different types of link.

Attributes:

  • AC

    Alternative current link.

  • DC

    Direct current link.

  • GAZ

    Gas link.

  • VIRTUAL

    Virtual link.

  • OTHER

    Other type of link.

Link(
    area_from: str,
    area_to: str,
    link_service: BaseLinkService,
    properties: Optional[LinkProperties] = None,
    ui: Optional[LinkUi] = None,
)

A link between two areas.

Methods:

Attributes:

Source code in src/antares/craft/model/link.py
def __init__(
    self,
    area_from: str,
    area_to: str,
    link_service: BaseLinkService,
    properties: Optional[LinkProperties] = None,
    ui: Optional[LinkUi] = None,
):
    self._area_from, self._area_to = sorted([area_from, area_to])
    self._link_service = link_service
    self._properties = properties or LinkProperties()
    self._ui = ui or LinkUi()

area_from_id property

area_from_id: str

Area from ID.

area_to_id property

area_to_id: str

Area to ID.

id property

id: str

ID of the link in the form "area_from/area_to".

properties property

properties: LinkProperties

Link properties.

ui property

ui: LinkUi

UI appearance properties.

get_capacity_direct

get_capacity_direct() -> DataFrame

Get direct transmission capacities of the link.

Returns:

  • DataFrame

    The hourly time-series of direct capacities.

Source code in src/antares/craft/model/link.py
def get_capacity_direct(self) -> pd.DataFrame:
    """Get direct transmission capacities of the link.

    Returns:
        The hourly time-series of direct capacities.
    """
    return self._link_service.get_capacity_direct(self.area_from_id, self.area_to_id)

get_capacity_indirect

get_capacity_indirect() -> DataFrame

Get indirect transmission capacities of the link.

Returns:

  • DataFrame

    The hourly time-series of indirect capacities.

Source code in src/antares/craft/model/link.py
def get_capacity_indirect(self) -> pd.DataFrame:
    """Get indirect transmission capacities of the link.

    Returns:
        The hourly time-series of indirect capacities.
    """
    return self._link_service.get_capacity_indirect(self.area_from_id, self.area_to_id)

get_parameters

get_parameters() -> DataFrame

Get parameters of the link

  • hurdle costs direct
  • hurdle costs indirect
  • impedances
  • loop flows
  • phase-shift min
  • phase-shift max

hourly time series.

Returns:

  • DataFrame

    The hourly time-series of the different parameters.

Source code in src/antares/craft/model/link.py
def get_parameters(self) -> pd.DataFrame:
    """Get parameters of the link

    - hurdle costs direct
    - hurdle costs indirect
    - impedances
    - loop flows
    - phase-shift min
    - phase-shift max

    hourly time series.

    Returns:
        The hourly time-series of the different parameters.
    """
    return self._link_service.get_parameters(self.area_from_id, self.area_to_id)

set_capacity_direct

set_capacity_direct(series: DataFrame) -> None

Set direct transmission capacities of the link.

Parameters:

  • series

    (DataFrame) –

    The hourly time-series of direct capacities.

Source code in src/antares/craft/model/link.py
def set_capacity_direct(self, series: pd.DataFrame) -> None:
    """Set direct transmission capacities of the link.

    Args:
        series: The hourly time-series of direct capacities.
    """
    self._link_service.set_capacity_direct(series, self.area_from_id, self.area_to_id)

set_capacity_indirect

set_capacity_indirect(series: DataFrame) -> None

Set indirect transmission capacities of the link.

Parameters:

  • series

    (DataFrame) –

    The hourly time-series of indirect capacities.

Source code in src/antares/craft/model/link.py
def set_capacity_indirect(self, series: pd.DataFrame) -> None:
    """Set indirect transmission capacities of the link.

    Args:
        series: The hourly time-series of indirect capacities.
    """
    self._link_service.set_capacity_indirect(series, self.area_from_id, self.area_to_id)

set_parameters

set_parameters(series: DataFrame) -> None

Set parameters of the link:

  • hurdle costs direct
  • hurdle costs indirect
  • impedances
  • loop flows
  • phase-shift min
  • phase-shift max

hourly time-series.

Parameters:

  • series

    (DataFrame) –

    The hourly time-series of the different parameters.

Source code in src/antares/craft/model/link.py
def set_parameters(self, series: pd.DataFrame) -> None:
    """Set parameters of the link:

    - hurdle costs direct
    - hurdle costs indirect
    - impedances
    - loop flows
    - phase-shift min
    - phase-shift max

    hourly time-series.

    Args:
        series: The hourly time-series of the different parameters.
    """
    self._link_service.set_parameters(series, self.area_from_id, self.area_to_id)

update_properties

Update link properties.

Parameters:

Returns:

Source code in src/antares/craft/model/link.py
def update_properties(self, properties: LinkPropertiesUpdate) -> LinkProperties:
    """Update link properties.

    Args:
        properties: Link properties to update and its associated new values.

    Returns:
        The updates properties.
    """
    new_properties = self._link_service.update_links_properties({self.id: properties})
    self._properties = new_properties[self.id]
    return self._properties

update_ui

update_ui(ui: LinkUiUpdate) -> LinkUi

Update UI appearance of the link.

Parameters:

  • ui

    (LinkUiUpdate) –

    Link UI properties to update and its associated new values.

Returns:

  • LinkUi

    The updates properties.

Source code in src/antares/craft/model/link.py
def update_ui(self, ui: LinkUiUpdate) -> LinkUi:
    """Update UI appearance of the link.

    Args:
        ui: Link UI properties to update and its associated new values.

    Returns:
        The updates properties.
    """
    new_ui = self._link_service.update_link_ui(self, ui)
    self._ui = new_ui
    return new_ui

LinkProperties dataclass

LinkProperties(
    hurdles_cost: bool = False,
    loop_flow: bool = False,
    use_phase_shifter: bool = False,
    transmission_capacities: TransmissionCapacities = ENABLED,
    asset_type: AssetType = AC,
    display_comments: bool = True,
    comments: str = "",
    filter_synthesis: set[FilterOption] = (lambda: FILTER_VALUES)(),
    filter_year_by_year: set[FilterOption] = (lambda: FILTER_VALUES)(),
)

Properties of a link between two areas.

Attributes:

  • hurdles_cost (bool) –

    Whether or not enable hurdle costs.

  • loop_flow (bool) –

    Whether or not enable loop flows.

  • use_phase_shifter (bool) –

    Whether or not enable phase-shifter.

  • transmission_capacities (TransmissionCapacities) –

    Selection of the transmission capacities (enabled, disabled, infinite).

  • asset_type (AssetType) –

    Type of the link (AC, DC, gaz, virtual or other).

  • display_comments (bool) –

    Whether or not display comments on the map.

  • comments (str) –

    Comments associated to the link.

  • filter_synthesis (set[FilterOption]) –

    Synthesis output filter (hourly, daily, weekly, monthly, annual).

  • filter_year_by_year (set[FilterOption]) –

    Output year-by-year filter (hourly, daily, weekly, monthly, annual).

LinkPropertiesUpdate dataclass

LinkPropertiesUpdate(
    hurdles_cost: Optional[bool] = None,
    loop_flow: Optional[bool] = None,
    use_phase_shifter: Optional[bool] = None,
    transmission_capacities: Optional[TransmissionCapacities] = None,
    asset_type: Optional[AssetType] = None,
    display_comments: Optional[bool] = None,
    comments: Optional[str] = None,
    filter_synthesis: Optional[set[FilterOption]] = None,
    filter_year_by_year: Optional[set[FilterOption]] = None,
)

Update the properties of a link between two areas.

Attributes:

  • hurdles_cost (Optional[bool]) –

    Whether or not enable hurdle costs.

  • loop_flow (Optional[bool]) –

    Whether or not enable loop flows.

  • use_phase_shifter (Optional[bool]) –

    Whether or not enable phase-shifter.

  • transmission_capacities (Optional[TransmissionCapacities]) –

    Selection of the transmission capacities (enabled, disabled, infinite).

  • asset_type (Optional[AssetType]) –

    Type of the link (AC, DC, gaz, virtual or other).

  • display_comments (Optional[bool]) –

    Whether or not display comments on the map.

  • comments (Optional[str]) –

    Comments associated to the link.

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

    Synthesis output filter (hourly, daily, weekly, monthly, annual).

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

    Output year-by-year filter (hourly, daily, weekly, monthly, annual).

LinkStyle

Enumeration of the different types styles of link in the UI.

Attributes:

  • DOT

    dotted line between areas.

  • PLAIN

    plain line between areas.

  • DASH

    dashed line between areas.

  • DOT_DASH

    dottes-dash line between areas.

LinkUi dataclass

LinkUi(
    link_style: LinkStyle = PLAIN,
    link_width: float = 1,
    colorr: int = 112,
    colorg: int = 112,
    colorb: int = 112,
)

Visual appearance of the link in the UI.

Attributes:

  • link_style (LinkStyle) –

    Style of the line.

  • link_width (float) –

    Width of the line.

  • colorr (int) –

    Red component of a RGB color in [0, 255].

  • colorg (int) –

    Green component of a RGB color in [0, 255].

  • colorb (int) –

    Blue component of a RGB color in [0, 255].

LinkUiUpdate dataclass

LinkUiUpdate(
    link_style: Optional[LinkStyle] = None,
    link_width: Optional[float] = None,
    colorr: Optional[int] = None,
    colorg: Optional[int] = None,
    colorb: Optional[int] = None,
)

Update the visual appearance of the link in the UI.

Attributes:

  • link_style (Optional[LinkStyle]) –

    Style of the line.

  • link_width (Optional[float]) –

    Width of the line.

  • colorr (Optional[int]) –

    Red component of a RGB color in [0, 255].

  • colorg (Optional[int]) –

    Green component of a RGB color in [0, 255].

  • colorb (Optional[int]) –

    Blue component of a RGB color in [0, 255].

TransmissionCapacities

Enumeration of the transmission capacities.

Attributes:

  • ENABLED

    The link is enabled.

  • DISABLED

    The link is disabled.

  • INFINITE

    Infinite transmission capacity.