model_factory
ModelFactory
Factory class for creating model instances based on the environment.
create_model
staticmethod
create_model(static_env: StaticEnvAir) -> ModelAir
create_model(static_env: StaticEnvSoil) -> ModelSoil
create_model(static_env: StaticEnvT) -> Model
Create a model instance based on the environment type.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
static_env
|
StaticEnvT
|
Static environment configuration for the model. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Model |
Model
|
An instance of ModelAir or ModelSoil, depending on the type of static_env. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If static_env is not a supported environment type. |
Source code in cable_thermal_model/model/model_factory.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |