oasislmf.preparation.il_inputs¶
Functions¶
|
merge selected il_inputs with the correct calc_rule table and return a pandas Series of calc. rule IDs |
|
Returns a Numpy array of policy TC IDs from a table of IL input items |
|
Returns a Numpy array of policy TC IDs from a table of IL input items that |
|
Generates and returns a Pandas dataframe of IL input items. |
|
Writes an FM policy T & C file. |
|
Writes an FM profile file. |
|
Writes an FM programme file. |
|
Writes an FM xref file. |
|
Writes standard Oasis IL input files to a target directory using a |
Module Contents¶
- oasislmf.preparation.il_inputs.get_calc_rule_ids(il_inputs_calc_rules_df, calc_rule_type)[source]¶
merge selected il_inputs with the correct calc_rule table and return a pandas Series of calc. rule IDs
- Args:
il_inputs_calc_rules_df (DataFrame): IL input items dataframe calc_rule_type (str): type of calc_rule to look for
- Returns:
pandas Series of calc. rule IDs
- oasislmf.preparation.il_inputs.get_profile_ids(il_inputs_df)[source]¶
Returns a Numpy array of policy TC IDs from a table of IL input items
- Parameters:
il_inputs_df (pandas.DataFrame) – IL input items dataframe
- Returns:
Numpy array of policy TC IDs
- Return type:
numpy.ndarray
- oasislmf.preparation.il_inputs.get_step_profile_ids(il_inputs_df, offset=0, idx_cols=[])[source]¶
Returns a Numpy array of policy TC IDs from a table of IL input items that include step policies
- Parameters:
il_inputs_df (pandas.DataFrame) – IL input items dataframe
step_trigger_type_cols – column names used to determine values for
terms indicators and types :type step_trigger_type_cols: list
- Returns:
Numpy array of policy TC IDs
- Return type:
numpy.ndarray
- oasislmf.preparation.il_inputs.get_il_input_items(gul_inputs_df, locations_df, accounts_df, oed_schema, exposure_profile=get_default_exposure_profile(), accounts_profile=get_default_accounts_profile(), fm_aggregation_profile=get_default_fm_aggregation_profile(), do_disaggregation=True)[source]¶
Generates and returns a Pandas dataframe of IL input items.
- Parameters:
locations_df (pandas.DataFrame) – Source exposure
gul_inputs_df (pandas.DataFrame) – GUL input items
accounts_df – Source accounts dataframe (optional)
accounts_df – pandas.DataFrame
accounts_fp – Source accounts file path (optional)
accounts_fp – str
exposure_profile (dict) – Source exposure profile (optional)
accounts_profile (dict) – Source accounts profile (optional)
fm_aggregation_profile – FM aggregation profile (optional)
fm_aggregation_profile – dict
do_disaggregation – whether to split terms and conditions for aggregate exposure (optional)
do_disaggregation – bool
- Returns:
IL inputs dataframe
- Return type:
pandas.DataFrame
:return Accounts dataframe :rtype: pandas.DataFrame
- oasislmf.preparation.il_inputs.write_fm_policytc_file(il_inputs_df, fm_policytc_fp, chunksize=100000)[source]¶
Writes an FM policy T & C file.
- oasislmf.preparation.il_inputs.write_fm_profile_file(il_inputs_df, fm_profile_fp, chunksize=100000)[source]¶
Writes an FM profile file.
- oasislmf.preparation.il_inputs.write_fm_programme_file(il_inputs_df, fm_programme_fp, chunksize=100000)[source]¶
Writes an FM programme file.
- oasislmf.preparation.il_inputs.write_fm_xref_file(il_inputs_df, fm_xref_fp, chunksize=100000)[source]¶
Writes an FM xref file.
- oasislmf.preparation.il_inputs.write_il_input_files(il_inputs_df, target_dir, oasis_files_prefixes=OASIS_FILES_PREFIXES['il'], chunksize=2 * 10**5)[source]¶
Writes standard Oasis IL input files to a target directory using a pre-generated dataframe of IL inputs dataframe. The files written are
fm_policytc.csv fm_profile.csv fm_programme.csv fm_xref.csv
- Parameters:
- Returns:
IL input files dict
- Return type: