diff --git a/openquake/qa_tests_data/event_based_risk/reinsurance_5/expected/reinsurance-aggcurves.csv b/openquake/qa_tests_data/event_based_risk/reinsurance_5/expected/reinsurance-aggcurves.csv index 0d0e884c97d2..cb44f7eb5159 100644 --- a/openquake/qa_tests_data/event_based_risk/reinsurance_5/expected/reinsurance-aggcurves.csv +++ b/openquake/qa_tests_data/event_based_risk/reinsurance_5/expected/reinsurance-aggcurves.csv @@ -1,5 +1,6 @@ -#,,,"generated_by='OpenQuake engine 3.18.0-git00abdf97f8', start_date='2023-09-18T09:11:45', checksum=1056964987" +#,,,"generated_by='OpenQuake engine 3.18.0-git9ab8269ea3', start_date='2023-09-25T07:31:13', checksum=1718747518" rlz_id,return_period,retention,claim -0,5.00000E+01,0.00000E+00,0.00000E+00 -0,1.00000E+02,1.07555E+02,1.07555E+02 -0,2.00000E+02,6.33285E+02,6.33285E+02 +0,5.00000E+01,5.47169E+01,5.47169E+01 +0,1.00000E+02,5.59046E+02,5.59046E+02 +0,2.00000E+02,2.20776E+03,2.20776E+03 +0,5.00000E+02,2.66082E+03,2.66082E+03 diff --git a/openquake/qa_tests_data/event_based_risk/reinsurance_5/job_1.ini b/openquake/qa_tests_data/event_based_risk/reinsurance_5/job_1.ini index 105d702f4993..14c021c80adf 100644 --- a/openquake/qa_tests_data/event_based_risk/reinsurance_5/job_1.ini +++ b/openquake/qa_tests_data/event_based_risk/reinsurance_5/job_1.ini @@ -27,7 +27,7 @@ truncation_level = 3 maximum_distance = 200.0 investigation_time = 1 number_of_logic_tree_samples = 0 -ses_per_logic_tree_path = 200 +ses_per_logic_tree_path = 500 [vulnerability] structural_vulnerability_file = structural_vulnerability_model.xml diff --git a/openquake/qa_tests_data/event_based_risk/reinsurance_5/job_2.ini b/openquake/qa_tests_data/event_based_risk/reinsurance_5/job_2.ini index 15a29ffa47f6..3ecc8cd4f492 100644 --- a/openquake/qa_tests_data/event_based_risk/reinsurance_5/job_2.ini +++ b/openquake/qa_tests_data/event_based_risk/reinsurance_5/job_2.ini @@ -27,7 +27,7 @@ truncation_level = 3 maximum_distance = 200.0 investigation_time = 1 number_of_logic_tree_samples = 0 -ses_per_logic_tree_path = 200 +ses_per_logic_tree_path = 500 [vulnerability] structural_vulnerability_file = structural_vulnerability_model.xml diff --git a/openquake/risklib/reinsurance.py b/openquake/risklib/reinsurance.py index 0b93d70ac43e..21b1a07f9ed6 100644 --- a/openquake/risklib/reinsurance.py +++ b/openquake/risklib/reinsurance.py @@ -56,12 +56,12 @@ def check_fields(fields, dframe, policyidx, fname, policyfname, treaties, :param treaty_types: treaty types """ key = fields[0] - [indices] = np.where(dframe.deductible.to_numpy() == '') + [indices] = np.where(np.isnan(dframe.deductible.to_numpy())) if len(indices) > 0: raise InvalidFile( '%s (rows %s): empty deductible values were found' % ( policyfname, [idx + 2 for idx in indices])) - [indices] = np.where(dframe.liability.to_numpy() == '') + [indices] = np.where(np.isnan(dframe.liability.to_numpy())) if len(indices) > 0: raise InvalidFile( '%s (rows %s): empty liability values were found' % ( @@ -234,8 +234,7 @@ def parse(fname, policy_idx): treaty['limit'].append(limit) treaty_linenos.append(node.lineno) policyfname = os.path.join(os.path.dirname(fname), ~rmodel.policies) - df = pd.read_csv(policyfname, keep_default_na=False).rename( - columns=fieldmap) + df = pd.read_csv(policyfname).rename(columns=fieldmap) df.columns = df.columns.str.strip() all_policies = df.policy.to_numpy() # ex ['A', 'B'] exp_policies = np.array(list(policy_idx)) # ex ['?', 'B', 'A']