OasisLMF / ReinsuranceTestTool

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

Error when running multiple CAT XL with 3 layers #37

Closed aiste-kalinauskaite closed 6 years ago

aiste-kalinauskaite commented 6 years ago

Error: Exec time: 0.4380793571472168

ValueError Traceback (most recent call last)

in () 1 # Step 9 - 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=do_reinsurance) 3 print("Ran {} inuring layers".format(len(net_losses) - 1)) 4 print("Losses for:") 5 for key in net_losses.keys(): ~/reinsurance_tester.py in run_test(run_name, account_df, location_df, ri_info_df, ri_scope_df, loss_factor, do_reinsurance, logger) 193 previous_inuring_priority, 194 previous_risk_level, --> 195 risk_level) 196 previous_inuring_priority = inuring_priority 197 previous_risk_level = risk_level ~/reinsurance_tester.py in run_inuring_level_risk_level(inuring_priority, account_df, location_df, items, coverages, fm_xrefs, xref_descriptions, ri_info_df, ri_scope_df, previous_inuring_priority, previous_risk_level, risk_level) 107 ) 108 --> 109 reinsurance_layer.generate_oasis_structures() 110 reinsurance_layer.write_oasis_files() 111 ~/reinsurance_layer.py in generate_oasis_structures(self) 686 level_id=node.level_id - 1, 687 agg_id=node.agg_id, --> 688 profile_id=max(profiles_ids) 689 )) 690 ValueError: max() arg is an empty sequence I ran 3 stacked layers (inuring priority = 1,2,3): - 50 xs 50 - 50 xs 100 - 50 xs 150 all with % placed = 0.5
aiste-kalinauskaite commented 6 years ago

Error occurs when ReinsLayerNumber is 1,2,3. It is not there, when ReinsLayerNumber = 1,1,1. It should work in both cases - it's user's choice if they want to differentiate between those layers with different numbers or not. Bear in mind that the user can go for 100,100,100 or 101, 102, 103. It's a free field, just limited to integers.

johcarter commented 6 years ago

@sambles please can you let Aiste know she can retest when you have removed the dependence on ReinsLayerNumber ?

aiste-kalinauskaite commented 6 years ago

This test now works as expected.