37 lines
904 B
Python
37 lines
904 B
Python
|
|
# generated by datamodel-codegen:
|
||
|
|
# filename: simulation_result.json
|
||
|
|
|
||
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
from enum import StrEnum
|
||
|
|
|
||
|
|
from pydantic import AwareDatetime, BaseModel, ConfigDict, conint, constr
|
||
|
|
|
||
|
|
|
||
|
|
class Kind(StrEnum):
|
||
|
|
REVENUE_SCENARIOS = 'REVENUE_SCENARIOS'
|
||
|
|
POWER_BALANCE = 'POWER_BALANCE'
|
||
|
|
|
||
|
|
|
||
|
|
class Simulator(BaseModel):
|
||
|
|
model_config = ConfigDict(
|
||
|
|
extra='forbid',
|
||
|
|
)
|
||
|
|
name: constr(min_length=1)
|
||
|
|
version: constr(min_length=1)
|
||
|
|
seed: conint(ge=-9007199254740991, le=9007199254740991)
|
||
|
|
|
||
|
|
|
||
|
|
class SimulationResult(BaseModel):
|
||
|
|
model_config = ConfigDict(
|
||
|
|
extra='forbid',
|
||
|
|
)
|
||
|
|
proposal_digest: constr(pattern=r'^[0-9a-f]{64}$')
|
||
|
|
kind: Kind
|
||
|
|
alert: bool
|
||
|
|
alerts: list[str]
|
||
|
|
metrics: dict[str, constr(pattern=r'^-?\d+(\.\d+)?$')]
|
||
|
|
scenario_count: conint(ge=0, le=9007199254740991)
|
||
|
|
simulator: Simulator
|
||
|
|
simulated_at: AwareDatetime
|