akkudoktoreos.prediction.interpolator.EOSLoadInterpolator

class akkudoktoreos.prediction.interpolator.EOSLoadInterpolator(*args: Any, **kwargs: Any)

Bases: SelfConsumptionProbabilityInterpolator, SingletonMixin

__init__() None

Initializes the singleton instance if it has not been initialized previously.

Further calls to __init__ are ignored for the singleton instance.

Parameters:
  • *args – Positional arguments for initialization.

  • **kwargs – Keyword arguments for initialization.

Methods

__init__()

Initializes the singleton instance if it has not been initialized previously.

calculate_self_consumption(load_1h_power, ...)

Calculate the PV self-consumption rate using RegularGridInterpolator.

reset_instance()

Resets the singleton instance, forcing it to be recreated on next access.

__init__() None

Initializes the singleton instance if it has not been initialized previously.

Further calls to __init__ are ignored for the singleton instance.

Parameters:
  • *args – Positional arguments for initialization.

  • **kwargs – Keyword arguments for initialization.

static __new__(cls: Type[SingletonMixin], *args: Any, **kwargs: Any) SingletonMixin

Creates or returns the singleton instance of the class.

Ensures thread-safe instance creation by locking during the first instantiation.

Parameters:
  • *args – Positional arguments for instance creation (ignored if instance exists).

  • **kwargs – Keyword arguments for instance creation (ignored if instance exists).

Returns:

The singleton instance of the derived class.

Return type:

SingletonMixin

calculate_self_consumption(load_1h_power: float, pv_power: float) float

Calculate the PV self-consumption rate using RegularGridInterpolator.

The results are cached until the start of the next energy management run/ optimization.

Parameters:
  • last_1h_power (-) – 1h power levels (W).

  • pv_power (-) – Current PV power output (W).

Returns:

  • Self-consumption rate as a float.

classmethod reset_instance() None

Resets the singleton instance, forcing it to be recreated on next access.