Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update EMDAT VARNAMES for version 2023 #701

Merged
merged 4 commits into from
Apr 27, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 51 additions & 1 deletion climada/engine/impact_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,57 @@
"Reconstruction Costs ('000 US$)": "Reconstruction Costs ('000 US$)",
"Insured Damages ('000 US$)": "Insured Damages ('000 US$)",
"Total Damages ('000 US$)": "Total Damages ('000 US$)",
'CPI': 'CPI'}}
'CPI': 'CPI'},
2023: {'Dis No': 'Dis No',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To make sure that all key-value pairs here are exactly the same, you could do something like this:

VARNAMES_EMDAT_2023 = ["Dis No", "Year", ...]  # List every variable only once
VARNAMES_EMDAT = {
    2018: {...},
    2020: {...},
    2023: dict(zip(VARNAMES_EMDAT_2023, VARNAMES_EMDAT_2023)),
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 Don't know. With the current change it is at least uniform. After introducing VARNAMES_EMDAT_2023 it's partly less redundant but loses uniformity. Which looks like an increase of entropy to me. 😁
Imho we should keep it uniform or get rid of all the redundancy when we start in this direction. E.g. by making a dictionary for only the values that are different from the keys.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I very much like your last suggestion! Let's get back to this when the actual issue is resolved ✌️

'Year': 'Year',
'Seq': 'Seq',
'Glide': 'Glide',
'Disaster Group': 'Disaster Group',
'Disaster Subgroup': 'Disaster Subgroup',
'Disaster Type': 'Disaster Type',
'Disaster Subtype': 'Disaster Subtype',
'Disaster Subsubtype': 'Disaster Subsubtype',
'Event Name': 'Event Name',
'Country': 'Country',
'ISO': 'ISO',
'Region': 'Region',
'Continent': 'Continent',
'Location': 'Location',
'Origin': 'Origin',
'Associated Dis': 'Associated Dis',
'Associated Dis2': 'Associated Dis2',
'OFDA Response': 'OFDA Response',
'Appeal': 'Appeal',
'Declaration': 'Declaration',
"AID Contribution ('000 US$)": "AID Contribution ('000 US$)",
'Dis Mag Value': 'Dis Mag Value',
'Dis Mag Scale': 'Dis Mag Scale',
'Latitude': 'Latitude',
'Longitude': 'Longitude',
'Local Time': 'Local Time',
'River Basin': 'River Basin',
'Start Year': 'Start Year',
'Start Month': 'Start Month',
'Start Day': 'Start Day',
'End Year': 'End Year',
'End Month': 'End Month',
'End Day': 'End Day',
'Total Deaths': 'Total Deaths',
'No Injured': 'No Injured',
'No Affected': 'No Affected',
'No Homeless': 'No Homeless',
'Total Affected': 'Total Affected',
"Reconstruction Costs ('000 US$)": "Reconstruction Costs ('000 US$)",
"Reconstruction Costs, Adjusted ('000 US$)": "Reconstruction Costs, Adjusted ('000 US$)",
"Insured Damages ('000 US$)": "Insured Damages ('000 US$)",
"Insured Damages, Adjusted ('000 US$)": "Insured Damages, Adjusted ('000 US$)",
"Total Damages ('000 US$)": "Total Damages ('000 US$)",
"Total Damages, Adjusted ('000 US$)": "Total Damages, Adjusted ('000 US$)",
'CPI': 'CPI',
'Adm Level': 'Adm Level',
'Admin1 Code': 'Admin1 Code',
'Admin2 Code': 'Admin2 Code',
'Geo Locations': 'Geo Locations'}}


def assign_hazard_to_emdat(certainty_level, intensity_path_haz, names_path_haz,
Expand Down