data_container
DataContainer
DataContainer()
Currently unused.
This class contains data from SectionArray, CableArray and WeatherArray. Its former goal was to allow SectionDataFrame to store all data in one class instead of three separate classes. Data is stored as attributes, allowing the use of .dict() method.
Source code in src/mechaphlowers/entities/data_container.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | |
add_cable_array
add_cable_array(cable_array: CableArray) -> None
Take as argument a CableArray, and add all data into its attributes. CableArray having only one row, we only keep data as np.float. The stress-strain polynomial is created, the coefficients are not kept.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
CableArray
|
the CableArray that contains data. |
required |
Raises:
| Type | Description |
|---|---|
NotImplementedError
|
raises error if CableArray does not have exactly one row. |
Source code in src/mechaphlowers/entities/data_container.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 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 | |
add_section_array
add_section_array(section_array: SectionArray) -> None
Take as argument a SectionArray, and add all data into its attributes
Source code in src/mechaphlowers/entities/data_container.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | |
add_weather_array
add_weather_array(weather_array: WeatherArray) -> None
Take as argument a WeatherArray, and add all data into its attributes
Source code in src/mechaphlowers/entities/data_container.py
122 123 124 125 | |
update_from_dict
Update the attributes of the instance based on a dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
dict
|
Dictionary containing attribute names as keys and their values. |
required |
Source code in src/mechaphlowers/entities/data_container.py
45 46 47 48 49 50 51 52 53 | |
factory_data_container
factory_data_container(
section_array: SectionArray,
cable_array: CableArray,
weather_array: WeatherArray,
) -> DataContainer
Function that creates a DataContainer from arrays.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
SectionArray
|
SectionArray |
required |
|
CableArray
|
CableArray |
required |
|
WeatherArray
|
WeatherArray |
required |
Returns:
| Name | Type | Description |
|---|---|---|
DataContainer |
DataContainer
|
DataContainer instance that contains data from the input arrays |
Source code in src/mechaphlowers/entities/data_container.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | |