model_output_schemas
TemperatureResultSchema
Bases: DataFrameModel
Schema for temperature result DataFrame with MultiIndex columns.
Structure: - Index: datetime (time series) - Columns: MultiIndex with 3 levels: - Level 0: circuit_name (str) - Level 1: cable_position (CablePosition enum values) - Level 2: cable_layer (CableLayer enum values) - Values: temperature in degrees Celsius (float)
check_datetime_index
classmethod
check_datetime_index(df: DataFrame)
Ensure index is datetime-like.
Source code in cable_thermal_model/model/schemas/model_output_schemas.py
31 32 33 34 35 | |
check_multiindex_columns
classmethod
check_multiindex_columns(df: DataFrame)
Ensure columns are a MultiIndex with 3 levels.
Source code in cable_thermal_model/model/schemas/model_output_schemas.py
37 38 39 40 41 42 43 44 | |
check_circuit_names
classmethod
check_circuit_names(df: DataFrame) -> bool
Ensure level-0 names are valid circuit names or the measurement-point prefix.
Source code in cable_thermal_model/model/schemas/model_output_schemas.py
46 47 48 49 50 51 52 53 54 55 56 | |
check_cable_positions
classmethod
check_cable_positions(df: DataFrame) -> bool
Validate level-1 and level-2 values by column type.
- For cable result columns: level 1 must be a valid CablePosition. Level 2 must be a valid CableLayer.
- For measurement-point columns: level 1 must be a string starting with 'x='. Level 2 must be a string starting with 'y='.
Source code in cable_thermal_model/model/schemas/model_output_schemas.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
check_temperature_values
classmethod
check_temperature_values(df: DataFrame) -> bool
Ensure temperature values are floats.
Source code in cable_thermal_model/model/schemas/model_output_schemas.py
84 85 86 87 88 89 90 91 | |
ModelOutputSchema
Bases: BaseModel, Generic[StateT]
Schema for the output of the thermal cable model, containing the temperature results and the final state.