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

Fix to demographics.py for case of no token prompt #938

Merged
merged 11 commits into from
Jun 12, 2024

Conversation

jdebacker
Copy link
Member

This PR fixes an issue with the recently updated demographics.py. When working with the module directly, users were prompted for a token. But when this function is called through other packages, this prompt doesn't seem to always appear. In case that happens, a try and except statement has been added so that even if the input prompt is not given, you the demographics still runs, resorting the the Population-Data repo.

In addition, a new utility is added that allows users to dump all the parameters from an instance of the Specifications class object into a JSON string. Among other uses, this makes it easy to create JSON files for the default parameters of different calibrations of OG-Core.

@codecov-commenter
Copy link

codecov-commenter commented Jun 12, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 71.93%. Comparing base (4e6ae04) to head (7255bbe).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #938      +/-   ##
==========================================
+ Coverage   71.92%   71.93%   +0.01%     
==========================================
  Files          19       19              
  Lines        4716     4725       +9     
==========================================
+ Hits         3392     3399       +7     
- Misses       1324     1326       +2     
Flag Coverage Δ
unittests 71.93% <83.33%> (+0.01%) ⬆️

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

Files Coverage Δ
ogcore/__init__.py 100.00% <100.00%> (ø)
ogcore/parameters.py 84.30% <100.00%> (ø)
ogcore/utils.py 86.49% <93.33%> (-0.05%) ⬇️
ogcore/demographics.py 56.97% <50.00%> (+0.08%) ⬆️

@jdebacker jdebacker marked this pull request as ready for review June 12, 2024 21:47
@jdebacker jdebacker merged commit c16cf28 into PSLmodels:master Jun 12, 2024
8 checks passed
@jdebacker jdebacker deleted the more_demog branch June 12, 2024 21:48
@rickecon
Copy link
Member

@jdebacker. Awesome.

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