oasislmf.preparation.gul_inputs¶
Functions¶
|
Generates and returns a Pandas dataframe of GUL input items. |
|
Writes a complex model items file. |
|
Writes a section id file based on the input location area perils. |
|
Writes an amplifications file. This is the mapping between item IDs and |
|
Writes an items file. |
|
Writes a coverages file. |
|
Writes the standard Oasis GUL input files to a target directory, using a |
Module Contents¶
- oasislmf.preparation.gul_inputs.get_gul_input_items(location_df, keys_df, correlations=False, peril_correlation_group_df=None, exposure_profile=get_default_exposure_profile(), damage_group_id_cols=None, hazard_group_id_cols=None, do_disaggregation=True)[source]¶
Generates and returns a Pandas dataframe of GUL input items.
- Parameters:
exposure_df (pandas.DataFrame) – Exposure dataframe
keys_df (pandas.DataFrame) – Keys dataframe
output_dir (str) – the output directory where input files are stored
exposure_profile (dict) – Exposure profile
damage_group_id_cols (list[str]) – Columns to be used to generate a hashed damage group id.
hazard_group_id_cols (list[str]) – Columns to be used to generate a hashed hazard group id.
do_disaggregation (bool) – If True, disaggregates by the number of buildings
- Returns:
GUL inputs dataframe
- Return type:
pandas.DataFrame
- oasislmf.preparation.gul_inputs.write_complex_items_file(gul_inputs_df, complex_items_fp, chunksize=100000)[source]¶
Writes a complex model items file.
- oasislmf.preparation.gul_inputs.write_sections_file(gul_inputs_df, sections_fp, chunksize=100000)[source]¶
Writes a section id file based on the input location area perils.
- Parameters:
gul_inputs_df (pandas.DataFrame) – GUL inputs dataframe
dynamic_events_fp – events file path to output
- oasislmf.preparation.gul_inputs.write_amplifications_file(gul_inputs_df, amplifications_fp, chunksize=100000)[source]¶
Writes an amplifications file. This is the mapping between item IDs and amplifications IDs.
- oasislmf.preparation.gul_inputs.write_items_file(gul_inputs_df, items_fp, chunksize=100000)[source]¶
Writes an items file.
- oasislmf.preparation.gul_inputs.write_coverages_file(gul_inputs_df, coverages_fp, chunksize=100000)[source]¶
Writes a coverages file.
- oasislmf.preparation.gul_inputs.write_gul_input_files(gul_inputs_df, target_dir, correlations_df, output_dir, oasis_files_prefixes=OASIS_FILES_PREFIXES['gul'], chunksize=2 * 10**5)[source]¶
Writes the standard Oasis GUL input files to a target directory, using a pre-generated dataframe of GUL input items. The files written are
items.csv coverages.csv
and optionally a complex items file in case of a complex/custom model.
- Parameters:
- Returns:
GUL input files dict
- Return type: