Closed SeaCelo closed 2 months ago
Great - thanks for keeping up with this @SeaCelo !
@rickecon and @SeaCelo Here's an idea: Since the UN data files are quite small (150KB gets you almost 100 years of the population distribution by age) and since relatively few users will be able to get a UN API token, what if we create repo in EAPD-DRB calls "UN Population Data". This will have a README briefly explaining the files and then directories for each OG-XXX model, which contain 5 CSV files with the relevant data for each country calibration.
We can then change the ogcore.demographics.get_un_data()
to have its current functionality if someone has the API token, but if not, it reads the relevant data files from the "UN Population Data" repo.
Some advantages of this:
1) It centralizes the storage of data so when there are changes to the UN WPP data (e.g., they add another forecast year), there's just one place to update them.
2) The ogcore.demographics
can remain largely the same.
Let me know your thoughts.
Addressed in PR #936 using the methods suggested in the previous comment.
The API for the UN population data used in
demographics.py
is being updated to use bearer tokens. The system is still not live, but the new format will look like this (requires a value foryour_token_here
):As soon as the API is live, and the method to generate the bearer token is published, I will update and test the code.