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
614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 | |
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.
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
663 664 665 666 667 | |
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
687 688 689 690 691 | |
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
776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 | |
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
803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 | |
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
863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 | |
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
898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 | |
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
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 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 | |
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
compute_ground_altitude() -> ndarray
Generate ground altitude array using attachment altitude, and arbitrary a support length.
Source code in src/mechaphlowers/entities/arrays.py
210 211 212 213 214 215 | |
correct_insulator_length
correct_insulator_length() -> None
Correct insulator length to be at least 0.01 m to avoid numerical issues.
Source code in src/mechaphlowers/entities/arrays.py
217 218 219 220 221 222 223 224 225 226 | |
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
347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | |
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
447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 | |
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
484 485 486 487 488 489 490 491 492 493 494 495 496 497 | |
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
499 500 501 502 503 504 505 506 507 508 509 510 511 512 | |
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
386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 | |
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
416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 | |
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
753 754 755 756 757 758 759 760 | |
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 | |