Skip to content

Commit 3b2dc6c

Browse files
authored
Merge pull request #41 from IFRCGo/fix/ifrc-transformation
fix ifrc transformation.
2 parents aee1962 + 04ef945 commit 3b2dc6c

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

pystac_monty/sources/ifrc_events.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def make_items(self) -> List[Item]:
5555
def make_source_event_items(self) -> List[Item]:
5656
"""Create ifrc event item"""
5757
items = []
58-
ifrc_data: List[Dict[str, Any]] = self.data.get_data()
58+
ifrc_data = self.check_and_get_ifrcevent_data()
5959

6060
for data in ifrc_data:
6161
item = self.make_source_event_item(data=data)
@@ -123,8 +123,8 @@ def map_ifrc_to_hazard_codes(self, classification_key: str) -> List[str]:
123123
"Volcanic Eruption": ["GH009", "GH0013", "GH0014", "GH0015", "GH0016"],
124124
"Tsunami": ["MH0029", "GH0006"],
125125
"Flood": ["FL"], # General flood
126-
"Cold Wave": "MH0040",
127-
"Fire": ["FR"],
126+
"Cold Wave": ["MH0040"],
127+
"Fire": ["FR", "tec-ind-fir-fir"],
128128
"Heat Wave": ["MH0047"],
129129
"Drought": ["MH0035"],
130130
"Storm Surge": ["MH0027"],
@@ -190,7 +190,7 @@ def make_impact_items(self) -> List[Item]:
190190
# only save impact value if not null
191191
value = None
192192
for field in impact_field:
193-
if src_data["field_reports"][0][field]: # take impact value from latest field report
193+
if len(src_data["field_reports"]) and src_data["field_reports"][0][field]:
194194
value = src_data["field_reports"][0][field]
195195
break
196196

@@ -227,6 +227,7 @@ def check_accepted_disaster_types(self, disaster):
227227
"Storm Surge",
228228
"Landslide",
229229
"Flash Flood",
230+
"Epidemic",
230231
]
231232
return disaster in monty_accepted_disaster_types
232233

0 commit comments

Comments
 (0)