cable_builder
Module responsible for building FDCable objects based on given cable specifications.
CableBuilder
Utility class responsible for constructing FDCable objects based on various input specifications.
build_cable_from_cable_id
classmethod
build_cable_from_cable_id(
cable_id: str,
fd_cable_class: type[CableT],
grid_points_per_layer: int = 10,
pipe: PipeInputSchema | None = None,
cable_source_file_path: Path = __PROJECT_ROOT
/ "data"
/ "example_cables.csv",
) -> CableT
Builds a new FDCable instance based on a cable_id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cable_id
|
str
|
The name of a cable mentioned in the file specified by |
required |
grid_points_per_layer
|
int
|
The number of points per cable layer. |
10
|
pipe
|
PipeInputSchema | None
|
A pipe instance to be added around the cable. |
None
|
fd_cable_class
|
type[FDCable]
|
The FDCable class to instantiate. |
required |
cable_source_file_path
|
Path
|
The path to the cable source file. Defaults to "data/example_cables.csv". The file can be either a CSV or an Excel file. |
__PROJECT_ROOT / 'data' / 'example_cables.csv'
|
Returns:
| Name | Type | Description |
|---|---|---|
TFDCable |
CableT
|
A new FDCable instance (based on a Cable instance). |
Source code in cable_thermal_model/cable/cable_builder.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 | |
build_cable_from_cable_specs
classmethod
build_cable_from_cable_specs(
cable_specs: Series,
fd_cable_class: type[CableT],
grid_points_per_layer: int = 10,
pipe: PipeInputSchema | None = None,
) -> CableT
Builds a new FDCable instance based on a given set of cable specifications.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cable_specs
|
Series
|
A Pandas Series holding the cable specification. |
required |
grid_points_per_layer
|
int | None
|
The number of points per layer to use in FD grids |
10
|
pipe
|
PipeInputSchema | None
|
A pipe instance to be added around the cable. |
None
|
fd_cable_class
|
type[FDCable]
|
The FDCable class to instantiate. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
TFDCable |
CableT
|
A new FDCable instance (based on a Cable instance). |
Source code in cable_thermal_model/cable/cable_builder.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | |
build_cable
classmethod
build_cable(
cable_constructional_input: CableConstructionalInputSchema,
fd_cable_class: type[CableT],
grid_points_per_layer: int = 10,
pipe: PipeInputSchema | None = None,
) -> CableT
Build FD cable object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cable_constructional_input
|
CableConstructionalInputSchema
|
A CableConstructionalInputSchema object holding the cable specification. |
required |
grid_points_per_layer
|
int
|
The number of points per layer to use in FD grids |
10
|
fd_cable_class
|
type[FDCable]
|
The FDCable class to instantiate. |
required |
pipe
|
PipeInputSchema | None
|
A pipe instance to be added around the cable. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
CableT |
CableT
|
A finite-difference cable object. |
Source code in cable_thermal_model/cable/cable_builder.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 | |