Skip to content

result

frequenz.sdk.actor.power_distributing.result ¤

Results from PowerDistributingActor.

Classes¤

frequenz.sdk.actor.power_distributing.result.Error dataclass ¤

Bases: Result

Result returned when an error occurred and power was not set at all.

Source code in frequenz/sdk/actor/power_distributing/result.py
@dataclasses.dataclass
class Error(Result):
    """Result returned when an error occurred and power was not set at all."""

    msg: str
    """The error message explaining why error happened."""
Attributes¤
msg: str instance-attribute ¤

The error message explaining why error happened.

frequenz.sdk.actor.power_distributing.result.OutOfBounds dataclass ¤

Bases: Result

Result returned when the power was not set because it was out of bounds.

This result happens when the originating request was done with adjust_power = False and the requested power is not within the batteries bounds.

Source code in frequenz/sdk/actor/power_distributing/result.py
@dataclasses.dataclass
class OutOfBounds(Result):
    """Result returned when the power was not set because it was out of bounds.

    This result happens when the originating request was done with
    `adjust_power = False` and the requested power is not within the batteries bounds.
    """

    bounds: PowerBounds
    """The power bounds for the requested batteries.

    If the requested power negative, then this value is the lower bound.
    Otherwise it is upper bound.
    """
Attributes¤
bounds: PowerBounds instance-attribute ¤

The power bounds for the requested batteries.

If the requested power negative, then this value is the lower bound. Otherwise it is upper bound.

frequenz.sdk.actor.power_distributing.result.PartialFailure dataclass ¤

Bases: _BaseSuccessMixin, Result

Result returned when any battery failed to perform the request.

Source code in frequenz/sdk/actor/power_distributing/result.py
@dataclasses.dataclass
class PartialFailure(_BaseSuccessMixin, Result):
    """Result returned when any battery failed to perform the request."""

    failed_power: Power
    """The part of the requested power that failed to be set."""

    failed_batteries: set[int]
    """The subset of batteries for which the request failed."""
Attributes¤
failed_batteries: set[int] instance-attribute ¤

The subset of batteries for which the request failed.

failed_power: Power instance-attribute ¤

The part of the requested power that failed to be set.

frequenz.sdk.actor.power_distributing.result.PowerBounds dataclass ¤

Inclusion and exclusion power bounds for requested batteries.

Source code in frequenz/sdk/actor/power_distributing/result.py
@dataclasses.dataclass
class PowerBounds:
    """Inclusion and exclusion power bounds for requested batteries."""

    inclusion_lower: float
    exclusion_lower: float
    exclusion_upper: float
    inclusion_upper: float

frequenz.sdk.actor.power_distributing.result.Result dataclass ¤

Bases: _BaseResultMixin

Power distribution result.

Source code in frequenz/sdk/actor/power_distributing/result.py
@dataclasses.dataclass
class Result(_BaseResultMixin):
    """Power distribution result."""

frequenz.sdk.actor.power_distributing.result.Success dataclass ¤

Bases: _BaseSuccessMixin, Result

Result returned when setting the power succeeded for all batteries.

Source code in frequenz/sdk/actor/power_distributing/result.py
@dataclasses.dataclass
class Success(_BaseSuccessMixin, Result):  # Order matters here. See above.
    """Result returned when setting the power succeeded for all batteries."""