oasislmf.pytools.data_layer.oasis_files.correlations
¶
This file defines the loading and saving for correlations data.
Module Contents¶
Classes¶
This class is responsible for managing the loading and saving of correlation data from binary and CSV files. |
Functions¶
|
Load the correlations from the correlations file. |
Attributes¶
- class oasislmf.pytools.data_layer.oasis_files.correlations.CorrelationsData(data: pandas.DataFrame | None = None)[source]¶
This class is responsible for managing the loading and saving of correlation data from binary and CSV files.
- Attributes:
data (Optional[pd.DataFrame): correlation data that is either loaded or saved
- static from_csv(file_path: str) CorrelationsData [source]¶
Loads correlations data from a CSV file.
- Args:
file_path: (str) the path to the CSV file housing the data
Returns: (CorrelationsData) the loaded data from the CSV file
- static from_bin(file_path: str) CorrelationsData [source]¶
Loads correlations data from a binary file.
- Args:
file_path: (str) the path to the binary file housing the data
Returns: (CorrelationsData) the loaded data from the binary file
- oasislmf.pytools.data_layer.oasis_files.correlations.read_correlations(input_path, ignore_file_type=set())[source]¶
Load the correlations from the correlations file.
- Args:
input_path (str): the path pointing to the file ignore_file_type (Set[str]): file extension to ignore when loading.
- Returns:
Tuple[Dict[int, int], List[int], Dict[int, int], List[Tuple[int, int]], List[int]] vulnerability dictionary, vulnerability IDs, areaperil to vulnerability index dictionary, areaperil ID to vulnerability index array, areaperil ID to vulnerability array