From 6212da882bdc7b85d5b4d93151c8bd9bf2e46a99 Mon Sep 17 00:00:00 2001 From: Michele Simionato Date: Mon, 11 Sep 2023 08:41:21 +0200 Subject: [PATCH] Added test for disagg_by_src in Japan --- openquake/calculators/tests/classical_test.py | 6 +++++- .../classical/case_27/expected/mean_rates_by_src.csv | 5 +++++ openquake/qa_tests_data/classical/case_27/job.ini | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 openquake/qa_tests_data/classical/case_27/expected/mean_rates_by_src.csv diff --git a/openquake/calculators/tests/classical_test.py b/openquake/calculators/tests/classical_test.py index df2c4f165351..5c97abb5d437 100644 --- a/openquake/calculators/tests/classical_test.py +++ b/openquake/calculators/tests/classical_test.py @@ -203,7 +203,11 @@ def test_case_27(self): # Nankai mutex model tot_probs_occur = sum(len(po) for po in probs_occur) self.assertEqual(tot_probs_occur, 4) # 2 x 2 - # make sure the disaggregation works + # check mean_rates_by_src + [fname] = export(('mean_rates_by_src', 'csv'), self.calc.datastore) + self.assertEqualFiles("expected/mean_rates_by_src.csv", fname) + + # make sure the disaggregation runs hc_id = str(self.calc.datastore.calc_id) self.run_calc(case_27.__file__, 'job.ini', hazard_calculation_id=hc_id, diff --git a/openquake/qa_tests_data/classical/case_27/expected/mean_rates_by_src.csv b/openquake/qa_tests_data/classical/case_27/expected/mean_rates_by_src.csv new file mode 100644 index 000000000000..6f9b92bea291 --- /dev/null +++ b/openquake/qa_tests_data/classical/case_27/expected/mean_rates_by_src.csv @@ -0,0 +1,5 @@ +#,,,"generated_by='OpenQuake engine 3.18.0-git6b799c22df', start_date='2023-09-11T08:26:57', checksum=3388380710, lon=135.68, lat=35.68" +src_id,imt,iml,value +case_01,PGV,2.00000E+01,5.98084E-02 +case_02,PGV,2.00000E+01,1.86467E-01 +gs_PSE_CPCF_2_100,PGV,2.00000E+01,2.40458E-03 diff --git a/openquake/qa_tests_data/classical/case_27/job.ini b/openquake/qa_tests_data/classical/case_27/job.ini index 96b9d3d8ae5f..171accf5b323 100644 --- a/openquake/qa_tests_data/classical/case_27/job.ini +++ b/openquake/qa_tests_data/classical/case_27/job.ini @@ -37,3 +37,4 @@ intensity_measure_types_and_levels = {"PGV": [20]} # km maximum_distance = 200. truncation_level = 99. +disagg_by_src = true