Skip to content

Commit deaab78

Browse files
samblesjohcarter
andauthored
Add correlation settings to PiWind testing (#99)
* Update PiWind model_settings.json * Update expected based on feature-correlated_rng branch * remove .npy files * Add *.npy to gitignore * Add model_settings to default test kwargs * Update results with model_settings added to tests * updated results for new correlation settings in model_settings.json * Updated tests? * Remove json files Co-authored-by: joh <[email protected]>
1 parent bb6b8d4 commit deaab78

File tree

174 files changed

+197028
-168921
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+197028
-168921
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,15 @@
22
__pycache__/
33
*.py[cod]
44
*$py.class
5+
*.npy
56

67
# C extensions
78
*.so
89

910
# Ktools binary files
1011
*.bin
1112

13+
1214
# Distribution / packaging
1315
.Python
1416
env/

meta-data/model_settings.json

+6-2
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@
1919
},
2020
"lookup_settings":{
2121
"supported_perils":[
22-
{"id": "WSS", "desc": "Single Peril: Storm Surge"},
23-
{"id": "WTC", "desc": "Single Peril: Tropical Cyclone"},
22+
{"id": "WSS", "desc": "Single Peril: Storm Surge", "peril_correlation_group": 1},
23+
{"id": "WTC", "desc": "Single Peril: Tropical Cyclone", "peril_correlation_group": 2},
2424
{"id": "WW1", "desc": "Group Peril: Windstorm with storm surge"},
2525
{"id": "WW2", "desc": "Group Peril: Windstorm w/o storm surge"}
2626
]
2727
},
28+
"correlation_settings": [
29+
{"peril_correlation_group": 1, "correlation_value": "0.7"},
30+
{"peril_correlation_group": 2, "correlation_value": "0.5"}
31+
],
2832
"data_settings": {
2933
"group_fields": ["PortNumber", "AccNumber", "LocNumber"]
3034
},
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
item_id,peril_correlation_group,correlation_value
2+
1,1,0.7
3+
2,2,0.5
4+
3,1,0.7
5+
4,2,0.5
6+
5,1,0.7
7+
6,2,0.5
8+
7,1,0.7
9+
8,2,0.5
10+
9,1,0.7
11+
10,2,0.5
12+
11,1,0.7
13+
12,2,0.5
14+
13,1,0.7
15+
14,2,0.5
16+
15,1,0.7
17+
16,2,0.5
18+
17,1,0.7
19+
18,2,0.5
20+
19,1,0.7
21+
20,2,0.5

tests/ci/expected/0_case/input/exposure_summary_report.json

+131-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"number_of_locations": 10
66
},
77
"not-modelled": {
8-
"tiv": 0.0,
8+
"tiv": 3400000.0,
99
"number_of_locations": 10
1010
},
1111
"portfolio": {
@@ -272,5 +272,135 @@
272272
"bi": 10
273273
}
274274
}
275+
},
276+
"WEC": {
277+
"all": {
278+
"tiv": 3400000.0,
279+
"tiv_by_coverage": {
280+
"buildings": 3400000.0,
281+
"other": 0.0,
282+
"contents": 0.0,
283+
"bi": 0.0
284+
},
285+
"number_of_locations": 10,
286+
"number_of_locations_by_coverage": {
287+
"buildings": 10,
288+
"other": 10,
289+
"contents": 10,
290+
"bi": 10
291+
}
292+
},
293+
"success": {
294+
"tiv": 0.0,
295+
"tiv_by_coverage": {
296+
"buildings": 0.0,
297+
"other": 0.0,
298+
"contents": 0.0,
299+
"bi": 0.0
300+
},
301+
"number_of_locations": 0,
302+
"number_of_locations_by_coverage": {
303+
"buildings": 0,
304+
"other": 0,
305+
"contents": 0,
306+
"bi": 0
307+
}
308+
},
309+
"fail": {
310+
"tiv": 0.0,
311+
"tiv_by_coverage": {
312+
"buildings": 0.0,
313+
"other": 0.0,
314+
"contents": 0.0,
315+
"bi": 0.0
316+
},
317+
"number_of_locations": 0,
318+
"number_of_locations_by_coverage": {
319+
"buildings": 0,
320+
"other": 0,
321+
"contents": 0,
322+
"bi": 0
323+
}
324+
},
325+
"nomatch": {
326+
"tiv": 0.0,
327+
"tiv_by_coverage": {
328+
"buildings": 0.0,
329+
"other": 0.0,
330+
"contents": 0.0,
331+
"bi": 0.0
332+
},
333+
"number_of_locations": 0,
334+
"number_of_locations_by_coverage": {
335+
"buildings": 0,
336+
"other": 0,
337+
"contents": 0,
338+
"bi": 0
339+
}
340+
},
341+
"fail_ap": {
342+
"tiv": 0.0,
343+
"tiv_by_coverage": {
344+
"buildings": 0.0,
345+
"other": 0.0,
346+
"contents": 0.0,
347+
"bi": 0.0
348+
},
349+
"number_of_locations": 0,
350+
"number_of_locations_by_coverage": {
351+
"buildings": 0,
352+
"other": 0,
353+
"contents": 0,
354+
"bi": 0
355+
}
356+
},
357+
"fail_v": {
358+
"tiv": 0.0,
359+
"tiv_by_coverage": {
360+
"buildings": 0.0,
361+
"other": 0.0,
362+
"contents": 0.0,
363+
"bi": 0.0
364+
},
365+
"number_of_locations": 0,
366+
"number_of_locations_by_coverage": {
367+
"buildings": 0,
368+
"other": 0,
369+
"contents": 0,
370+
"bi": 0
371+
}
372+
},
373+
"notatrisk": {
374+
"tiv": 0.0,
375+
"tiv_by_coverage": {
376+
"buildings": 0.0,
377+
"other": 0.0,
378+
"contents": 0.0,
379+
"bi": 0.0
380+
},
381+
"number_of_locations": 0,
382+
"number_of_locations_by_coverage": {
383+
"buildings": 0,
384+
"other": 0,
385+
"contents": 0,
386+
"bi": 0
387+
}
388+
},
389+
"noreturn": {
390+
"tiv": 3400000.0,
391+
"tiv_by_coverage": {
392+
"buildings": 3400000.0,
393+
"other": 0.0,
394+
"contents": 0.0,
395+
"bi": 0.0
396+
},
397+
"number_of_locations": 10,
398+
"number_of_locations_by_coverage": {
399+
"buildings": 10,
400+
"other": 10,
401+
"contents": 10,
402+
"bi": 10
403+
}
404+
}
275405
}
276406
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
loc_id,portnumber,accnumber,locnumber,peril_id,coverage_type_id,tiv,status,message
2+
1,1,A11111,10002082046,WEC,1,220000.0,noreturn,unsuported peril_id
3+
1,1,A11111,10002082046,WEC,3,0.0,noreturn,unsuported peril_id
4+
2,1,A11111,10002082047,WEC,1,790000.0,noreturn,unsuported peril_id
5+
2,1,A11111,10002082047,WEC,3,0.0,noreturn,unsuported peril_id
6+
3,1,A11111,10002082048,WEC,1,160000.0,noreturn,unsuported peril_id
7+
3,1,A11111,10002082048,WEC,3,0.0,noreturn,unsuported peril_id
8+
4,1,A11111,10002082049,WEC,1,30000.0,noreturn,unsuported peril_id
9+
4,1,A11111,10002082049,WEC,3,0.0,noreturn,unsuported peril_id
10+
5,1,A11111,10002082050,WEC,1,250000.0,noreturn,unsuported peril_id
11+
5,1,A11111,10002082050,WEC,3,0.0,noreturn,unsuported peril_id
12+
6,1,A11111,10002082051,WEC,1,700000.0,noreturn,unsuported peril_id
13+
6,1,A11111,10002082051,WEC,3,0.0,noreturn,unsuported peril_id
14+
7,1,A11111,10002082052,WEC,1,90000.0,noreturn,unsuported peril_id
15+
7,1,A11111,10002082052,WEC,3,0.0,noreturn,unsuported peril_id
16+
8,1,A11111,10002082053,WEC,1,310000.0,noreturn,unsuported peril_id
17+
8,1,A11111,10002082053,WEC,3,0.0,noreturn,unsuported peril_id
18+
9,1,A11111,10002082054,WEC,1,420000.0,noreturn,unsuported peril_id
19+
9,1,A11111,10002082054,WEC,3,0.0,noreturn,unsuported peril_id
20+
10,1,A11111,10002082055,WEC,1,430000.0,noreturn,unsuported peril_id
21+
10,1,A11111,10002082055,WEC,3,0.0,noreturn,unsuported peril_id
+20-20
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
item_id,coverage_id,areaperil_id,vulnerability_id,group_id
2-
1,1,154,8,1
3-
2,1,54,2,1
4-
3,2,154,8,2
5-
4,2,54,2,2
6-
5,3,154,8,3
7-
6,3,54,2,3
8-
7,4,154,8,4
9-
8,4,54,2,4
10-
9,5,154,8,5
11-
10,5,54,2,5
12-
11,6,154,8,6
13-
12,6,54,2,6
14-
13,7,154,8,7
15-
14,7,54,2,7
16-
15,8,154,8,8
17-
16,8,54,2,8
18-
17,9,154,8,9
19-
18,9,54,2,9
20-
19,10,154,8,10
21-
20,10,54,2,10
2+
1,1,154,8,833720067
3+
2,1,54,2,741910550
4+
3,2,154,8,956003481
5+
4,2,54,2,2021160731
6+
5,3,154,8,335506702
7+
6,3,54,2,357048375
8+
7,4,154,8,2030714556
9+
8,4,54,2,80768587
10+
9,5,154,8,1448362624
11+
10,5,54,2,1777520933
12+
11,6,154,8,6452306
13+
12,6,54,2,1497558717
14+
13,7,154,8,1172065003
15+
14,7,54,2,1610454076
16+
15,8,154,8,1247804892
17+
16,8,54,2,703397145
18+
17,9,154,8,356089808
19+
18,9,54,2,290437283
20+
19,10,154,8,1130278724
21+
20,10,54,2,1785489759
Original file line numberDiff line numberDiff line change
@@ -1 +1,21 @@
11
LocID,PerilID,CoverageTypeID,Status,Message
2+
1,WEC,1,noreturn,unsuported peril_id
3+
2,WEC,1,noreturn,unsuported peril_id
4+
3,WEC,1,noreturn,unsuported peril_id
5+
4,WEC,1,noreturn,unsuported peril_id
6+
5,WEC,1,noreturn,unsuported peril_id
7+
6,WEC,1,noreturn,unsuported peril_id
8+
7,WEC,1,noreturn,unsuported peril_id
9+
8,WEC,1,noreturn,unsuported peril_id
10+
9,WEC,1,noreturn,unsuported peril_id
11+
10,WEC,1,noreturn,unsuported peril_id
12+
1,WEC,3,noreturn,unsuported peril_id
13+
2,WEC,3,noreturn,unsuported peril_id
14+
3,WEC,3,noreturn,unsuported peril_id
15+
4,WEC,3,noreturn,unsuported peril_id
16+
5,WEC,3,noreturn,unsuported peril_id
17+
6,WEC,3,noreturn,unsuported peril_id
18+
7,WEC,3,noreturn,unsuported peril_id
19+
8,WEC,3,noreturn,unsuported peril_id
20+
9,WEC,3,noreturn,unsuported peril_id
21+
10,WEC,3,noreturn,unsuported peril_id

0 commit comments

Comments
 (0)