composite_solution
composite_solution
¶
This module provides the CompositeSolution class.
Classes:
Name | Description |
---|---|
CompositeSolution |
a container class collecting FaultSystemSolution instances. |
Classes¶
CompositeSolution(source_logic_tree: logic_tree.SourceLogicTree)
¶
A container class collecting FaultSystemSolution instances and a source_logic_tree.
Methods:
Name | Description |
---|---|
add_fault_system_solution |
|
archive_path |
|
from_archive |
|
get_fault_system_codes |
|
get_fault_system_solution |
|
source_logic_tree |
|
to_archive |
|
Instantiate a new instance.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
source_logic_tree
|
logic_tree.SourceLogicTree
|
the logic tree instance. |
required |
Source code in solvis/solution/composite_solution.py
41 42 43 44 45 46 47 48 |
|
Attributes¶
archive_path: Union[Path, None]
property
¶
Get the path of the instance.
source_logic_tree
property
¶
Get the source_logic_tree instance.
rupture_rates: pd.DataFrame
property
¶
Calculate (and cache) the rupture rates.
Returns:
Type | Description |
---|---|
pd.DataFrame
|
a |
composite_rates: pd.DataFrame
property
¶
Calculate (and cache) the composite rates.
Returns:
Type | Description |
---|---|
pd.DataFrame
|
a |
fault_sections_with_rupture_rates: pd.DataFrame
property
¶
Get a dataframe containing the fault sections for all fault_system_solutions.
Returns:
Type | Description |
---|---|
pd.DataFrame
|
a |
Functions¶
add_fault_system_solution(fault_system: str, fault_system_solution: FaultSystemSolution)
¶
Add a new FaultSystemSolution instance.
Source code in solvis/solution/composite_solution.py
51 52 53 54 55 56 57 58 59 |
|
rupture_surface(fault_system: str, rupture_id: int) -> gpd.GeoDataFrame
¶
Source code in solvis/solution/composite_solution.py
61 62 |
|
fault_surfaces()
¶
Source code in solvis/solution/composite_solution.py
64 65 66 67 68 69 70 71 |
|
to_archive(archive_path: Union[Path, str])
¶
Serialize a CompositeSolution instance to a zip archive.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
archive_path
|
Union[Path, str]
|
a valid target file path. |
required |
Source code in solvis/solution/composite_solution.py
144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
|
from_archive(archive_path: Path, source_logic_tree: logic_tree.SourceLogicTree) -> CompositeSolution
staticmethod
¶
Deserialize a CompositeSolution instance from an archive path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
archive_path
|
Path
|
a valid target file path. |
required |
source_logic_tree
|
logic_tree.SourceLogicTree
|
a source_logic_tree instance. |
required |
Source code in solvis/solution/composite_solution.py
162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
|
get_fault_system_codes() -> Iterable[str]
¶
List fault systems contained within the composite solution.
For the NSHM model this will typically be PUY for Puysegur, HIK for Hikurangi, CRU for Crustal.
Returns:
Type | Description |
---|---|
Iterable[str]
|
A list of fault system keys. |
Source code in solvis/solution/composite_solution.py
187 188 189 190 191 192 193 194 195 196 197 |
|
get_fault_system_solution(fault_system_code: str) -> FaultSystemSolution
¶
Retrieve a FaultSystemSolution
from within the composite solution.
Codes can be retrieved with
get_fault_system_codes
Parameters:
Name | Type | Description | Default |
---|---|---|---|
fault_system_code
|
str
|
a named fault system code |
required |
Returns:
Type | Description |
---|---|
FaultSystemSolution
|
a specific FaultSystemSolution |
Source code in solvis/solution/composite_solution.py
199 200 201 202 203 204 205 206 207 208 209 210 211 |
|