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

Conversation

simonameiler
Copy link
Collaborator

Work in progress!

Update the EMDAT variables names to meet the EMDAT data structure criteria of the year 2023

to do:

  • check and update all functions which use VARNAMES_EMDAT

Changes proposed in this PR:

  • updated VARNAMES_EMDAT dictionary with most recent variables (2023)

This PR fixes #690

PR Author Checklist

PR Reviewer Checklist

Update the EMDAT variables names to meet data structure criteria of the year 2023
@@ -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 ✌️

@emanuel-schmid emanuel-schmid marked this pull request as ready for review April 27, 2023 11:31
@emanuel-schmid
Copy link
Collaborator

After manually checking the tutorial, I leave it as it is for now. But the module should be refactored at some point: #708

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants