Skip to content

Commit

Permalink
Merge pull request #9295 from gem/case_master
Browse files Browse the repository at this point in the history
Simplified classical_risk/case_master
  • Loading branch information
micheles authored Dec 20, 2023
2 parents 8381300 + 2384be9 commit 732ca0b
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 135 deletions.
7 changes: 7 additions & 0 deletions openquake/calculators/tests/classical_risk_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,13 @@ def test_case_5(self):

def test_case_master(self):
self.run_calc(case_master.__file__, 'job.ini')

# checking the avg_losses
[fname] = export(('avg_losses-stats', 'csv'), self.calc.datastore)
self.assertEqualFiles('expected/' + strip_calc_id(fname),
fname, delta=1E-5)

# checking the loss maps
fnames = export(('loss_maps-stats', 'csv'), self.calc.datastore)
assert fnames # sanity check
for fname in fnames:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#,,,,,,,,"generated_by='OpenQuake engine 3.19.0-git10c084cb04', start_date='2023-12-20T17:13:17', checksum=2065913176, investigation_time=50.0, risk_investigation_time=50.0"
asset_id,taxonomy,lon,lat,business_interruption,contents,nonstructural,occupants,structural
a3,tax1,-122.57000,38.11300,9.27133E+00,6.15716E+01,8.29307E+01,1.85427E-04,3.11339E+01

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
#,,,,,,,,,,,,,"generated_by='OpenQuake engine 3.19.0-git53a176a4ab', start_date='2023-12-20T05:43:04', checksum=266296396, kind='quantile-0.15', risk_investigation_time=50.0"
asset_id,taxonomy,lon,lat,business_interruption~poe-0.02,business_interruption~poe-0.1,contents~poe-0.02,contents~poe-0.1,nonstructural~poe-0.02,nonstructural~poe-0.1,occupants~poe-0.02,occupants~poe-0.1,structural~poe-0.02,structural~poe-0.1
a3,tax1,-122.57000,38.11300,1.13949E+02,3.43991E+01,8.25346E+02,1.95994E+02,1.04705E+03,2.93991E+02,2.27898E-03,6.87982E-04,3.51518E+02,1.01563E+02
a2,tax2,-122.11400,38.11300,3.11337E+02,1.85305E+02,5.00000E+03,3.62622E+03,8.48422E+03,4.18529E+03,6.22674E-03,3.70610E-03,7.05986E+02,3.75640E+02
a5,tax1,-122.00000,37.91000,1.98193E+02,1.63393E+02,1.63283E+03,1.29929E+03,1.78419E+03,1.47969E+03,3.96385E-03,3.26787E-03,8.81250E+02,5.59166E+02
a4,tax3,-122.00000,38.00000,7.01269E+02,3.20990E+02,5.00000E+03,3.21210E+03,1.23700E+04,4.95369E+03,1.40254E-02,6.41980E-03,3.18403E+03,1.38016E+03
a1,tax1,-122.00000,38.11300,1.30874E+03,5.75561E+02,5.00000E+03,4.16214E+03,1.14562E+04,5.27888E+03,2.61748E-02,1.15112E-02,6.56637E+03,2.73533E+03
a6,tax2,-122.00000,38.22500,5.87856E+02,2.72355E+02,5.00000E+03,4.69922E+03,1.44296E+04,7.90401E+03,1.17571E-02,5.44710E-03,1.63058E+03,6.75091E+02
a7,tax1,-121.88600,38.11300,3.13972E+02,1.85661E+02,2.59452E+03,1.51177E+03,2.82649E+03,1.67432E+03,6.27944E-03,3.71322E-03,1.36703E+03,8.03265E+02
#,,,,,,,,"generated_by='OpenQuake engine 3.19.0-git94cdc0555c', start_date='2023-12-20T16:50:47', checksum=2065913176, kind='quantile-0.15', risk_investigation_time=50.0"
asset_id,taxonomy,lon,lat,business_interruption~poe-0.02,contents~poe-0.02,nonstructural~poe-0.02,occupants~poe-0.02,structural~poe-0.02
a3,tax1,-122.57000,38.11300,1.13949E+02,8.25346E+02,1.04705E+03,2.27898E-03,3.51518E+02

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,6 @@
</conversions>

<assets>
<asset id="a1" number="1" area="100" taxonomy="tax1" >
<location lon="-122.000" lat="38.113" />
<costs>
<cost type="structural" value="10000" deductible="0.1" insuranceLimit="0.8" />
<cost type="nonstructural" value="15000" deductible="0.1" insuranceLimit="0.8" />
<cost type="contents" value="5000" deductible="0.1" insuranceLimit="0.8" />
<cost type="business_interruption" value="2000" deductible="0.1" insuranceLimit="0.8" />
</costs>
<occupancies>
<occupancy occupants="2" period="day" />
<occupancy occupants="4" period="transit" />
<occupancy occupants="6" period="night" />
</occupancies>
</asset>

<asset id="a2" number="1" area="100" taxonomy="tax2" >
<location lon="-122.114" lat="38.113" />
<costs>
<cost type="structural" value="10000" deductible="0.1" insuranceLimit="0.8" />
<cost type="nonstructural" value="15000" deductible="0.1" insuranceLimit="0.8" />
<cost type="contents" value="5000" deductible="0.1" insuranceLimit="0.8" />
<cost type="business_interruption" value="2000" deductible="0.1" insuranceLimit="0.8" />
</costs>
<occupancies>
<occupancy occupants="2" period="day" />
<occupancy occupants="4" period="transit" />
<occupancy occupants="6" period="night" />
</occupancies>
</asset>

<asset id="a3" number="1" area="100" taxonomy="tax1" >
<location lon="-122.570" lat="38.113" />
Expand All @@ -60,66 +31,6 @@
</occupancies>
</asset>

<asset id="a4" number="1" area="100" taxonomy="tax3" >
<location lon="-122.000" lat="38.000" />
<costs>
<cost type="structural" value="10000" deductible="0.1" insuranceLimit="0.8" />
<cost type="nonstructural" value="15000" deductible="0.1" insuranceLimit="0.8" />
<cost type="contents" value="5000" deductible="0.1" insuranceLimit="0.8" />
<cost type="business_interruption" value="2000" deductible="0.1" insuranceLimit="0.8" />
</costs>
<occupancies>
<occupancy occupants="2" period="day" />
<occupancy occupants="4" period="transit" />
<occupancy occupants="6" period="night" />
</occupancies>
</asset>

<asset id="a5" number="1" area="100" taxonomy="tax1" >
<location lon="-122.000" lat="37.910" />
<costs>
<cost type="structural" value="10000" deductible="0.1" insuranceLimit="0.8" />
<cost type="nonstructural" value="15000" deductible="0.1" insuranceLimit="0.8" />
<cost type="contents" value="5000" deductible="0.1" insuranceLimit="0.8" />
<cost type="business_interruption" value="2000" deductible="0.1" insuranceLimit="0.8" />
</costs>
<occupancies>
<occupancy occupants="2" period="day" />
<occupancy occupants="4" period="transit" />
<occupancy occupants="6" period="night" />
</occupancies>
</asset>

<asset id="a6" number="1" area="100" taxonomy="tax2" >
<location lon="-122.000" lat="38.225" />
<costs>
<cost type="structural" value="10000" deductible="0.1" insuranceLimit="0.8" />
<cost type="nonstructural" value="15000" deductible="0.1" insuranceLimit="0.8" />
<cost type="contents" value="5000" deductible="0.1" insuranceLimit="0.8" />
<cost type="business_interruption" value="2000" deductible="0.1" insuranceLimit="0.8" />
</costs>
<occupancies>
<occupancy occupants="2" period="day" />
<occupancy occupants="4" period="transit" />
<occupancy occupants="6" period="night" />
</occupancies>
</asset>

<asset id="a7" number="1" area="100" taxonomy="tax1" >
<location lon="-121.886" lat="38.113" />
<costs>
<cost type="structural" value="10000" deductible="0.1" insuranceLimit="0.8" />
<cost type="nonstructural" value="15000" deductible="0.1" insuranceLimit="0.8" />
<cost type="contents" value="5000" deductible="0.1" insuranceLimit="0.8" />
<cost type="business_interruption" value="2000" deductible="0.1" insuranceLimit="0.8" />
</costs>
<occupancies>
<occupancy occupants="2" period="day" />
<occupancy occupants="4" period="transit" />
<occupancy occupants="6" period="night" />
</occupancies>
</asset>

</assets>
</exposureModel>

Expand Down
13 changes: 3 additions & 10 deletions openquake/qa_tests_data/classical_risk/case_master/job.ini
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,8 @@ intensity_measure_types_and_levels = {
'SA(0.4)': logscale(0.05, 3.0, 30),}

[hazard_outputs]
mean = true
quantiles = 0.15, 0.50, 0.85
hazard_maps = true
poes = 0.02, 0.10
uniform_hazard_spectra = true
mean = false
quantiles = 0.15

[vulnerability]
structural_vulnerability_file = structural_vulnerability_model.xml
Expand All @@ -51,12 +48,8 @@ business_interruption_vulnerability_file = downtime_vulnerability_model.xml
occupants_vulnerability_file = occupants_vulnerability_model.xml

[risk_calculation]
#asset_hazard_distance = 20
risk_investigation_time = 50
lrem_steps_per_interval = 1

[risk_outputs]
conditional_loss_poes = 0.02, 0.10

[export]
export_dir = ./
conditional_loss_poes = 0.02

0 comments on commit 732ca0b

Please sign in to comment.