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 file calls in calibration modules #112

Merged
merged 22 commits into from
Jun 4, 2024

Conversation

rickecon
Copy link
Member

@rickecon rickecon commented May 20, 2024

This PR:

  • Updates the file calls in some of the calibration modules (bequest_transmission.py, deterministic_profiles.py, psid_data_setup.py, and transfer_distirbution.py). These files called .RData files that were not included in the ogusa package, so users who pip installed ogusa could not instantiate the Calibrate class object. These changes allow for Jupyter notebook users to automatically download the data files from the master branch of the GitHub repository if they are not working in their own branch of the repository.

I ran all the tests on my local machine and they all passed. And I verified that I could run a modified run_og_usa.py run script from a Jupyter notebook that was not in the branch structures of my OG-USA repository.

cc: @jdebacker

@codecov-commenter
Copy link

codecov-commenter commented May 20, 2024

Codecov Report

Attention: Patch coverage is 54.09836% with 28 lines in your changes missing coverage. Please review.

Project coverage is 73.29%. Comparing base (60f204f) to head (379ebdf).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #112      +/-   ##
==========================================
- Coverage   75.49%   73.29%   -2.21%     
==========================================
  Files          11       11              
  Lines         857      865       +8     
==========================================
- Hits          647      634      -13     
- Misses        210      231      +21     
Flag Coverage Δ
unittests 73.29% <54.09%> (-2.21%) ⬇️

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

Files Coverage Δ
ogusa/constants.py 100.00% <100.00%> (ø)
ogusa/income.py 100.00% <100.00%> (ø)
ogusa/calibrate.py 37.32% <66.66%> (-0.09%) ⬇️
ogusa/psid_data_setup.py 98.85% <80.00%> (-1.15%) ⬇️
ogusa/transfer_distribution.py 50.00% <38.88%> (-12.80%) ⬇️
ogusa/bequest_transmission.py 44.44% <35.00%> (-12.08%) ⬇️

... and 1 file with indirect coverage changes

@rickecon
Copy link
Member Author

@jdebacker. Here is the output of running all the tests locally on my machine.

(ogusa-dev) richardevans@Richards-MacBook-Pro-2 OG-USA % pytest
============================= test session starts ==============================
platform darwin -- Python 3.11.9, pytest-8.2.0, pluggy-1.5.0
rootdir: /Users/richardevans/Docs/Economics/OSE/OG-USA
configfile: pytest.ini
testpaths: ./tests
plugins: cov-5.0.0, xdist-3.5.0
collected 37 items                                                             

tests/test_calibrate.py ....                                             [ 10%]
tests/test_get_micro_data.py ..............                              [ 48%]
tests/test_income.py ............                                        [ 81%]
tests/test_psid_data_setup.py ...                                        [ 89%]
tests/test_run_example.py .                                              [ 91%]
tests/test_utils.py .                                                    [ 94%]
tests/test_wealth.py ..                                                  [100%]
================= 37 passed, 110 warnings in 678.02s (0:11:18) =================

@rickecon
Copy link
Member Author

rickecon commented Jun 3, 2024

@jdebacker. I merged your PR to my branch. This PR is now ready for final review.

CHANGELOG.md Outdated

### Added

- Updates the file calls in some of the calibration modules (`bequest_transmission.py`, `deterministic_profiles.py`, `psid_data_setup.py`, and `transfer_distirbution.py`). These files called `.RData` files that were not included in the `ogusa` package, so users who pip installed ogusa could not instantiate the `Calibrate` class object. These changes allow for Jupyter notebook users to automatically download the data files from the master branch of the GitHub repository if they are not working in their own branch of the repository.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rickecon I think we should update this. Perhaps:

Updates the `ogusa` package to include the zipped `psid_lifetime_income.csv.gz` file, which is now called in some calibration modules (`bequest_transmission.py`,  `deterministic_profiles.py`, and `transfer_distirbution.py`), but with an option for the user to provide their own custom datafile.  These changes allow for Jupyter notebook users to execute the `Calibration` class object and for those who install the `ogusa` package from PyPI to have the required datafile for the major calibration modules.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jdebacker. I just made this change.

@jdebacker
Copy link
Member

thank you @rickecon! Merging.

@jdebacker jdebacker merged commit 29acbee into PSLmodels:master Jun 4, 2024
6 checks passed
@rickecon rickecon deleted the ntbkrun branch June 4, 2024 07:31
@jdebacker jdebacker mentioned this pull request Oct 9, 2024
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