Skip to content

Add Japan (392) to the offline demographics country map - #1196

Open
arihantlodha-cmd wants to merge 1 commit into
PSLmodels:masterfrom
arihantlodha-cmd:add-japan-country-code
Open

Add Japan (392) to the offline demographics country map#1196
arihantlodha-cmd wants to merge 1 commit into
PSLmodels:masterfrom
arihantlodha-cmd:add-japan-country-code

Conversation

@arihantlodha-cmd

Copy link
Copy Markdown
Contributor

Adds "392": "JPN" to the country_dict in ogcore/demographics.py, so the offline data fallback (used when no UN API token is present) can find Japan's demographic data by country code, like the other supported countries.

This pairs with EAPD-DRB/Population-Data#14, which adds the Japan data (Data/JPN/) to the mirror this fallback reads from. That PR should merge first; on its own this entry has no data behind it yet.

Motivation: I'm building an open-source OG model of Japan on top of OG-Core, and Japan is currently the only major economy without an OG country model. This (plus the data PR) lets OG-Core use Japan demographics offline. With a UN API token the live pull already works for Japan (code 392); this just extends the token-free path.

Maps UN country code 392 to JPN so get_un_data's offline fallback finds
Japan's data (EAPD-DRB/Population-Data#14) when no API token is present,
like the other supported countries.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.74%. Comparing base (a8b0232) to head (bb8831e).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1196   +/-   ##
=======================================
  Coverage   72.74%   72.74%           
=======================================
  Files          22       22           
  Lines        5768     5768           
=======================================
  Hits         4196     4196           
  Misses       1572     1572           
Flag Coverage Δ
unittests 72.74% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
ogcore/demographics.py 58.50% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@marcelolafleur

Copy link
Copy Markdown
Contributor

Thanks @arihantlodha-cmd — the entry looks right. One note for whoever merges: Data/JPN doesn't exist on the Population-Data side yet, so this would 404 today. Being sorted in EAPD-DRB/Population-Data#14.

Also, while you're in this dict — worth adding "242": "FJI". Fiji landed in the archive this morning and this map missed it, so the offline path KeyErrors on Fiji right now.

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