model_factory
ModelFactory
Factory class for creating model instances based on the environment.
create_model
staticmethod
create_model(
static_env: StaticEnvAir,
scenario: DataFrame[ScenarioSchemaAir],
) -> ModelAir
create_model(
static_env: StaticEnvSoil,
scenario: DataFrame[ScenarioSchemaSoil],
) -> ModelSoil
create_model(
static_env: StaticEnv,
scenario: DataFrame[ScenarioSchemaAir]
| DataFrame[ScenarioSchemaSoil],
) -> Model
Create a model instance based on the environment type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
static_env
|
StaticEnv
|
Static environment configuration for the model. |
required |
scenario
|
DataFrame[ScenarioSchemaAir] | DataFrame[ScenarioSchemaSoil]
|
Scenario data used by the model. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Model |
Model
|
An instance of ModelAir or ModelSoil. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If static_env is not a supported environment type. |
Source code in cable_thermal_model/model/model_factory.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | |