68 lines
1.7 KiB
Python
68 lines
1.7 KiB
Python
|
|
# generated by datamodel-codegen:
|
||
|
|
# filename: dispatch_optimization_result.json
|
||
|
|
|
||
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from enum import StrEnum
|
||
|
|
from typing import Literal
|
||
|
|
|
||
|
|
from pydantic import BaseModel, ConfigDict, Field, RootModel, conint, constr
|
||
|
|
|
||
|
|
|
||
|
|
class Value(RootModel[constr(pattern=r'^-?\d+(\.\d+)?$')]):
|
||
|
|
root: constr(pattern=r'^-?\d+(\.\d+)?$')
|
||
|
|
|
||
|
|
|
||
|
|
class TotalTargetMw(BaseModel):
|
||
|
|
model_config = ConfigDict(
|
||
|
|
extra='forbid',
|
||
|
|
)
|
||
|
|
interval_minutes: Literal[15]
|
||
|
|
date: constr(pattern=r'^\d{4}-\d{2}-\d{2}$')
|
||
|
|
values: list[Value] = Field(..., max_length=96, min_length=96)
|
||
|
|
|
||
|
|
|
||
|
|
class TargetMw(BaseModel):
|
||
|
|
model_config = ConfigDict(
|
||
|
|
extra='forbid',
|
||
|
|
)
|
||
|
|
interval_minutes: Literal[15]
|
||
|
|
date: constr(pattern=r'^\d{4}-\d{2}-\d{2}$')
|
||
|
|
values: list[Value] = Field(..., max_length=96, min_length=96)
|
||
|
|
|
||
|
|
|
||
|
|
class Allocation(BaseModel):
|
||
|
|
model_config = ConfigDict(
|
||
|
|
extra='forbid',
|
||
|
|
)
|
||
|
|
unit_id: constr(min_length=1)
|
||
|
|
target_mw: TargetMw
|
||
|
|
|
||
|
|
|
||
|
|
class Status(StrEnum):
|
||
|
|
OPTIMAL = 'OPTIMAL'
|
||
|
|
INFEASIBLE = 'INFEASIBLE'
|
||
|
|
ERROR = 'ERROR'
|
||
|
|
|
||
|
|
|
||
|
|
class Solver(BaseModel):
|
||
|
|
model_config = ConfigDict(
|
||
|
|
extra='forbid',
|
||
|
|
)
|
||
|
|
name: constr(min_length=1)
|
||
|
|
version: constr(min_length=1)
|
||
|
|
status: Status
|
||
|
|
wall_time_ms: conint(ge=0, le=9007199254740991)
|
||
|
|
|
||
|
|
|
||
|
|
class DispatchOptimizationResult(BaseModel):
|
||
|
|
model_config = ConfigDict(
|
||
|
|
extra='forbid',
|
||
|
|
)
|
||
|
|
market_date: constr(pattern=r'^\d{4}-\d{2}-\d{2}$')
|
||
|
|
total_target_mw: TotalTargetMw
|
||
|
|
allocations: list[Allocation] = Field(..., min_length=1)
|
||
|
|
shortfall_mwh: constr(pattern=r'^-?\d+(\.\d+)?$')
|
||
|
|
solver: Solver
|
||
|
|
skill_version: constr(pattern=r'^\d+\.\d+\.\d+$')
|