-
-
Notifications
You must be signed in to change notification settings - Fork 132
Pre-time path population #1071
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
Pre-time path population #1071
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses Issue #1070 by updating the demographics module to use actual UN historical data for determining pre-time path population distribution instead of solving backwards from period 1 rates. This change improves accuracy in countries like Ethiopia that experience large year-to-year swings in demographic parameters. Additionally, the PR removes the deprecated timeout parameter from a client.gather() call to maintain compatibility with updated versions of dask.
- Replaces backward-solving logic for pre-period population with direct use of UN historical data
- Adds validation and warning logic to verify consistency between UN pre-period data and period 0 population
- Updates dask client call to remove deprecated
timeoutparameter
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 6 comments.
| File | Description |
|---|---|
| ogcore/demographics.py | Comments out the old backward-solving implementation and replaces it with direct use of UN historical data for pre-period population, adds verification logic with warning for large inconsistencies |
| ogcore/SS.py | Removes deprecated timeout parameter from client.gather() call to maintain compatibility with updated dask versions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1071 +/- ##
==========================================
- Coverage 72.70% 72.44% -0.27%
==========================================
Files 21 21
Lines 5111 5098 -13
==========================================
- Hits 3716 3693 -23
- Misses 1395 1405 +10
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
This looks good to me. Thanks for running this down. And I look forward to working on a more robust solution to Issue #1070 in the future. |
This PR updates
demographics.pyto use the UN data to determine the population distribution in the period before the model starts. The module had been using the period 1 population distribution, fertility, mortality, and immigration rates to work backwards to solve for this. But in some countries (e.g. Ethiopia) there are large swings in these from year to year and so the inferred population was not consistent with the actual population.In addition, a change is made to a
client.gathercall since dask has removed thetimeoutkwarg.Addresses Issue #1070.