OasisLMF / ReinsuranceTestTool

Test tool for new reinsurance functionality.
BSD 3-Clause "New" or "Revised" License
3 stars 1 forks source link

remove DirectLayer class in direct_layer.py module #76

Closed johcarter closed 5 years ago

johcarter commented 5 years ago

smurthy [10:28 AM] The RI tester module is importing this DirectLayer class in the direct_layer.py module, to generate Oasis files, and the RI tester module is being imported in the notebook. This is completely unnecessary as we can use the MDK (utils/deterministic_loss.py module) to generate the direct Oasis files


Test case dev branch, run_direct.ipynb, using examples_old/ftest/fm3 Error

Step 7 - run the OED data though the Oasis Financial Module and output the losses by item at each inuring level.

net_losses = reinsurance_tester.run_test('run_reinsurance', account_df, location_df, ri_info_df, ri_scope_df, loss_factor=1.0, do_reinsurance=False)

print("Ran {} inuring layers".format(len(net_losses) - 1))

print("Losses for:")

for key in net_losses.keys():

print("\t{}".format(key))

Exec time: 0.026910066604614258


AttributeError Traceback (most recent call last)

in 1 # Step 7 - run the OED data though the Oasis Financial Module and output the losses by item at each inuring level. ----> 2 net_losses = reinsurance_tester.run_test('run_reinsurance', account_df, location_df, ri_info_df, ri_scope_df, loss_factor=1.0, do_reinsurance=False) 3 print("Ran {} inuring layers".format(len(net_losses) - 1)) 4 print("Losses for:") 5 for key in net_losses.keys(): /media/sf_C_DRIVE/msys64/home/Joh/ReinsuranceTestTool/reinsurance_tester.py in run_test(run_name, account_df, location_df, ri_info_df, ri_scope_df, loss_factor, do_reinsurance, logger) 89 90 direct_layer = DirectLayer(account_df, location_df) ---> 91 direct_layer.generate_oasis_structures() 92 direct_layer.write_oasis_files() 93 losses_df = direct_layer.apply_fm( /media/sf_C_DRIVE/msys64/home/Joh/ReinsuranceTestTool/direct_layer.py in generate_oasis_structures(self) 70 oed.get_profile( 71 profile_id, ---> 72 deductible=policy.AccDed6All, 73 limit=policy.AccLimit6All)) 74 fm_policytcs_list.append(oed.FmPolicyTc( ~/ReinsuranceTestTool/venv3/lib/python3.6/site-packages/pandas/core/generic.py in __getattr__(self, name) 5065 if self._info_axis._can_hold_identifiers_and_holds_name(name): 5066 return self[name] -> 5067 return object.__getattribute__(self, name) 5068 5069 def __setattr__(self, name, value): AttributeError: 'Series' object has no attribute 'AccDed6All'
johcarter commented 5 years ago

Is anyone looking at this please? As i mentioned on Friday, it is blocking my testing. cheers

sr-murthy commented 5 years ago

@johcarter I've updated the notebook in dev with a fix. I think it should be OK now, but a confirmation would be useful.

https://github.com/OasisLMF/ReinsuranceTestTool/commit/02a5286c31e17eb7bdae43b0e5a6f415659dea3b

johcarter commented 5 years ago

Thanks. have rerun with ftest/fm3 and I still get the same error;

AttributeError Traceback (most recent call last)

in 1 # Step 11 - run the OED data though the Oasis Financial Module and output the losses by item at each inuring level. ----> 2 net_losses = reinsurance_tester.run_test('run_reinsurance', account_df, location_df, ri_info_df, ri_scope_df, loss_factor=1.0, do_reinsurance=False) 3 print("Ran {} inuring layers".format(len(net_losses) - 1)) 4 print("Losses for:") 5 for key in net_losses.keys(): /media/sf_C_DRIVE/msys64_2/home/Joh/ReinsuranceTestTool/reinsurance_tester.py in run_test(run_name, account_df, location_df, ri_info_df, ri_scope_df, loss_factor, do_reinsurance, logger) 89 90 direct_layer = DirectLayer(account_df, location_df) ---> 91 direct_layer.generate_oasis_structures() 92 direct_layer.write_oasis_files() 93 losses_df = direct_layer.apply_fm( /media/sf_C_DRIVE/msys64_2/home/Joh/ReinsuranceTestTool/direct_layer.py in generate_oasis_structures(self) 70 oed.get_profile( 71 profile_id, ---> 72 deductible=policy.AccDed6All, 73 limit=policy.AccLimit6All)) 74 fm_policytcs_list.append(oed.FmPolicyTc( ~/ReinsuranceTestTool/venv3/lib/python3.6/site-packages/pandas/core/generic.py in __getattr__(self, name) 5065 if self._info_axis._can_hold_identifiers_and_holds_name(name): 5066 return self[name] -> 5067 return object.__getattribute__(self, name) 5068 5069 def __setattr__(self, name, value): AttributeError: 'Series' object has no attribute 'AccDed6All'