BenchmarkTarget#

class openstef_beam.benchmarking.BenchmarkTarget(**data: Any) None[source]#

Bases: BaseConfig

Base class for benchmark targets with common properties.

Defines the core properties that all benchmark targets must have, ensuring a consistent interface across different benchmark implementations.

Raises:

ValueError – When benchmark_end <= benchmark_start, train_start >= benchmark_start, or when limit constraints are not met (either ‘limit’ alone or both ‘upper_limit’ and ‘lower_limit’ must be specified).

Parameters:

data (Any)

name: str#

Unique identifier for the benchmark target

description: str#

Human-readable description of the target

group_name: str#

Group name for categorizing targets

latitude: Latitude#

Geographical latitude of the target location

longitude: Longitude#

Geographical longitude of the target location

limit: float | None#

Capacity limit of the target in appropriate units

upper_limit: float | None#

Upper capacity limit of the target in appropriate units

lower_limit: float | None#

Lower capacity limit of the target in appropriate units

benchmark_start: datetime#

Start timestamp of the benchmark period

benchmark_end: datetime#

End timestamp of the benchmark period

train_start: datetime#

Start timestamp of the training period

validate_limits() BenchmarkTarget[source]#

Validate that either limit or both upper_limit and lower_limit are provided.

Return type:

BenchmarkTarget

Returns:

The validated BenchmarkTarget instance.

Raises:

ValueError – If neither limit nor (upper_limit and lower_limit) are provided, or if both limit and (upper_limit or lower_limit) are provided.

classmethod validate_benchmark_end(v: datetime, info: ValidationInfo) datetime[source]#

Validate that benchmark_end occurs after benchmark_start.

Parameters:
  • v (datetime) – The benchmark_end value to validate.

  • info (ValidationInfo) – Validation context containing other field values.

  • v

  • info

Returns:

The validated benchmark_end datetime.

Raises:

ValueError – If benchmark_end is not after benchmark_start.

Return type:

datetime

classmethod validate_train_start(v: datetime, info: ValidationInfo) datetime[source]#

Validate that train_start occurs before benchmark_start.

Parameters:
  • v (datetime) – The train_start value to validate.

  • info (ValidationInfo) – Validation context containing other field values.

  • v

  • info

Returns:

The validated train_start datetime.

Raises:

ValueError – If train_start is not before benchmark_start.

Return type:

datetime

model_config: ClassVar[ConfigDict] = {'arbitrary_types_allowed': False, 'extra': 'ignore', 'protected_namespaces': ()}#

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].