arrays
CableArray
CableArray(
data: DataFrame,
tensile_strength: ITensileStrength | None = None,
)
Bases: ElementArray
Physical description of a cable.
Holds catalog data for one cable type and provides RRTS (Residual Rated
Tensile Strength) calculations via rrts and utilization_rate.
Use cut_strands to declare the number of damaged strands per layer.
The tensile strength model is handled by
AdditiveLayerRts
by default, but any ITensileStrength implementation
can be injected via the tensile_strength constructor argument.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
DataFrame
|
Input data as a DataFrame matching
|
required |
|
ITensileStrength | None
|
Optional tensile strength model. Defaults to
|
None
|
Source code in src/mechaphlowers/entities/arrays.py
725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 | |
cut_strands
property
writable
cut_strands: ndarray
Delegated to the tensile strength model. See
ITensileStrength.cut_strands.
data_mecha
property
data_mecha: DataFrame
Returns mechanical data for cable. These attributes are stored in mecha_attributes
data_original
property
data_original: DataFrame
Original dataframe with the exact same data as input: original units and no columns added
data_thermal
property
data_thermal: DataFrame
Returns thermal data for cable. These attributes are stored in thermal_attributes
high_safety
property
writable
high_safety: bool
Delegated to the tensile strength model. See
ITensileStrength.high_safety.
is_bimetallic
property
is_bimetallic: NDArray[bool]
Whether the cable is bimetallic.
nb_strand_per_layer
property
nb_strand_per_layer: ndarray
Delegated to the tensile strength model. See
ITensileStrength.nb_strand_per_layer.
safety_coefficient
property
safety_coefficient: float
Delegated to the tensile strength model. See
ITensileStrength.safety_coefficient.
add_units
add_units(input_units: dict[str, str]) -> None
Add dictionary of units of the data input . This will overrides the default input_units dict
input_units has the following format:
1 2 3 4 | |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict[str, str]
|
dictionary of columns names and corresponding units |
required |
Source code in src/mechaphlowers/entities/arrays.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
rts_coverage
rts_coverage() -> float
Delegated to the tensile strength model. See
ITensileStrength.rts_coverage.
Source code in src/mechaphlowers/entities/arrays.py
774 775 776 777 778 | |
utilization_rate
utilization_rate(tension_sup_N: ndarray) -> ndarray
Delegated to the tensile strength model. See
ITensileStrength.utilization_rate.
Source code in src/mechaphlowers/entities/arrays.py
798 799 800 801 802 | |
DefaultValueWarning
Bases: Warning
Warning for default values being used when not provided by user.
ElementArray
ElementArray(data: DataFrame)
Bases: ABC
Source code in src/mechaphlowers/entities/arrays.py
52 53 54 55 56 | |
data
property
data: DataFrame
Returns a copy of self._data that converts values into SI units
data_original
property
data_original: DataFrame
Original dataframe with the exact same data as input: original units and no columns added
add_units
add_units(input_units: dict[str, str]) -> None
Add dictionary of units of the data input . This will overrides the default input_units dict
input_units has the following format:
1 2 3 4 | |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict[str, str]
|
dictionary of columns names and corresponding units |
required |
Source code in src/mechaphlowers/entities/arrays.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
ObstacleArray
ObstacleArray(data: DataFrame)
Bases: ElementArray
Obstacles-related data, such as obstacle altitude and distance from the line.
They are typically used to compute clearance-related checks.
Source code in src/mechaphlowers/entities/arrays.py
894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 | |
data_original
property
data_original: DataFrame
Original dataframe with the exact same data as input: original units and no columns added
add_obstacle
add_obstacle(
name: str,
span_index: int,
coords: ndarray,
object_type: str = 'ground',
support_reference: Literal['left', 'right'] = 'left',
span_length: ndarray | None = None,
overwrite: bool = True,
)
Method used for adding an obstacle to ObstacleArray
coords format: [[x0, y0, z0], [x1, y1, z1],...]
If support_reference == "right", span_length is required.
If overwrite == True, will overwrite if name already exists. Else, it will add points to obstacle
Source code in src/mechaphlowers/entities/arrays.py
921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 | |
add_units
add_units(input_units: dict[str, str]) -> None
Add dictionary of units of the data input . This will overrides the default input_units dict
input_units has the following format:
1 2 3 4 | |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict[str, str]
|
dictionary of columns names and corresponding units |
required |
Source code in src/mechaphlowers/entities/arrays.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
delete_obstacle
delete_obstacle(
obs_names_to_delete: str | list[str],
) -> None
Deletes obstacles by name. Can delete multiple obstacles at once
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str | list[str]
|
str or list of obstacles to delete |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If obstacle name to delete is not found |
TypeError
|
If obs_names_to_delete is not a str or a list |
Source code in src/mechaphlowers/entities/arrays.py
981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 | |
delete_point
delete_point(obs_name: str, point_index: int) -> None
Delete single point of an obstacle.
Refers to the point by obstacle name and point index.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
name of obstacle point to delete |
required |
|
int
|
point_index of point to delete |
required |
Source code in src/mechaphlowers/entities/arrays.py
1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 | |
SectionArray
SectionArray(
data: DataFrame,
sagging_parameter: float | None = None,
sagging_temperature: float | None = None,
bundle_number: int = 1,
)
Bases: ElementArray
Description of an overhead line section.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
DataFrame
|
Input data |
required |
|
float | None
|
Sagging parameter |
None
|
|
float | None
|
Sagging temperature, in Celsius degrees |
None
|
Source code in src/mechaphlowers/entities/arrays.py
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 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | |
angle_direction
property
writable
angle_direction: Literal['clockwise', 'anticlockwise']
Affects line_angle, crossarm_length sign
If "anticlockwise", line_angle is anticlockwise and crossarm_length is away from user (left). If "clockwise", line_angle is clockwise and crossarm_length is towards user (right).
Defaults to "anticlockwise".
data_original
property
data_original: DataFrame
Original dataframe with the exact same data as input (except for sagging_parameter and sagging_temperature which are added if not provided in input) original units and no (other) columns added
add_units
add_units(input_units: dict[str, str]) -> None
Add dictionary of units of the data input . This will overrides the default input_units dict
input_units has the following format:
1 2 3 4 | |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict[str, str]
|
dictionary of columns names and corresponding units |
required |
Source code in src/mechaphlowers/entities/arrays.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |
compute_ground_altitude
classmethod
compute_ground_altitude(
suspension: NDArray[bool],
conductor_attachment_altitude: ndarray,
insulator_length: ndarray,
bundle_number: int,
support_height: ndarray | None = None,
) -> ndarray
Generate ground altitude array.
Source code in src/mechaphlowers/entities/arrays.py
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 | |
correct_insulator_length
classmethod
correct_insulator_length(data: DataFrame) -> None
Correct insulator length to be at least 0.01 m to avoid numerical issues.
Source code in src/mechaphlowers/entities/arrays.py
275 276 277 278 279 280 281 | |
equivalent_span
equivalent_span() -> float
Compute equivalent span length.
Used in the default value of sagging_parameter.
compute equivalent span
\(L_{eq} = \sqrt{\sum(L_i ^ 3)/\sum L_i}\)
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
equivalent span length (m) |
Source code in src/mechaphlowers/entities/arrays.py
424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 | |
get_azimuth
get_azimuth(
unit: str = 'deg',
output_direction: Literal[
'clockwise', 'anticlockwise'
] = 'anticlockwise',
) -> ndarray
Compute azimuth angle (or bearing) of the section. By default, using anti-clockwise sense : 0 is toward North. 90 degrees is toward West.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
str
|
Output unit. Defaults to "deg". |
'deg'
|
|
Literal['clockwise', 'anticlockwise']
|
Angle sense for output. If set to "clockwise": 90 means East, -90 means West. Default to "anticlockwise" |
'anticlockwise'
|
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: array of the azimuth of each span. |
Source code in src/mechaphlowers/entities/arrays.py
558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 | |
get_gps
get_gps() -> tuple[ndarray, ndarray]
Compute GPS coordinates for all pylons.
Requires set_starting_gps() or set_starting_lambert93() to have been called first.
Returns:
| Type | Description |
|---|---|
tuple[ndarray, ndarray]
|
tuple[np.ndarray, np.ndarray]: (latitudes, longitudes) in decimal degrees. |
Source code in src/mechaphlowers/entities/arrays.py
595 596 597 598 599 600 601 602 603 604 605 606 607 608 | |
get_lambert93
get_lambert93() -> tuple[ndarray, ndarray]
Compute Lambert 93 coordinates for all pylons.
Requires set_starting_gps() or set_starting_lambert93() to have been called first.
Returns:
| Type | Description |
|---|---|
tuple[ndarray, ndarray]
|
tuple[np.ndarray, np.ndarray]: (easting, northing) in Lambert 93 meters. |
Source code in src/mechaphlowers/entities/arrays.py
610 611 612 613 614 615 616 617 618 619 620 621 622 623 | |
set_starting_gps
set_starting_gps(
latitude_0: float,
longitude_0: float,
azimuth_0: float,
azimuth_direction: Literal[
'clockwise', 'anticlockwise'
] = 'anticlockwise',
) -> None
Set the starting GPS point and azimuth for coordinate computation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
float
|
Latitude of the first support in decimal degrees. |
required |
|
float
|
Longitude of the first support in decimal degrees. |
required |
|
float
|
Azimuth of the first span in degrees, anti-clockwise by default. 0 means North, 90 means West. |
required |
|
Literal['clockwise', 'anticlockwise']
|
Angle sense for azimuth_0. If set to "clockwise": 90 means East, -90 means West. Default to "anticlockwise" |
'anticlockwise'
|
Source code in src/mechaphlowers/entities/arrays.py
497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 | |
set_starting_lambert93
set_starting_lambert93(
easting: float,
northing: float,
azimuth_0: float,
azimuth_direction: Literal[
'clockwise', 'anticlockwise'
] = 'anticlockwise',
) -> None
Set the starting point from Lambert 93 coordinates and azimuth.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
float
|
Lambert 93 easting coordinate in meters. |
required |
|
float
|
Lambert 93 northing coordinate in meters. |
required |
|
float
|
Azimuth of the first span in degrees, anti-clockwise. 0 means North, 90 means West. |
required |
|
Literal['clockwise', 'anticlockwise']
|
Angle sense for azimuth_0. If set to "clockwise": 90 means East, -90 means West. Default to "anticlockwise" |
'anticlockwise'
|
Source code in src/mechaphlowers/entities/arrays.py
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 | |
WeatherArray
WeatherArray(data: DataFrame)
Bases: ElementArray
Weather-related data, such as wind and ice.
They're typically used to compute weather-related loads on the cable.
Source code in src/mechaphlowers/entities/arrays.py
871 872 873 874 875 876 877 878 | |
data
property
data: DataFrame
Returns a copy of self._data that converts values into SI units
data_original
property
data_original: DataFrame
Original dataframe with the exact same data as input: original units and no columns added
add_units
add_units(input_units: dict[str, str]) -> None
Add dictionary of units of the data input . This will overrides the default input_units dict
input_units has the following format:
1 2 3 4 | |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict[str, str]
|
dictionary of columns names and corresponding units |
required |
Source code in src/mechaphlowers/entities/arrays.py
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | |