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 tax function indexing #878

Merged
merged 13 commits into from
Sep 6, 2023
Merged

Conversation

jdebacker
Copy link
Member

This PR fixes two cases of tax function parameters not being indexed (or sized) correctly.

The first is a change to parameters.py to make sure tax functions that are input are extrapolated to the appropriate model dimensions. This addresses Issue #877.

Second is a changes to the plotting of 2D tax functions in parameter_plots.py. This function had not been updated (or not correctly updated) to notes that the dimensions of the lists of lists of tax functions parameters are TxS. The change here is to make sure time period index is given before the age index.

@codecov-commenter
Copy link

codecov-commenter commented Sep 4, 2023

Codecov Report

Merging #878 (0b48a79) into master (816aeec) will increase coverage by 0.05%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #878      +/-   ##
==========================================
+ Coverage   79.93%   79.98%   +0.05%     
==========================================
  Files          18       18              
  Lines        4146     4157      +11     
==========================================
+ Hits         3314     3325      +11     
  Misses        832      832              
Flag Coverage Δ
unittests 79.98% <100.00%> (+0.05%) ⬆️

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

Files Changed Coverage Δ
ogcore/firm.py 97.35% <100.00%> (+0.11%) ⬆️
ogcore/parameter_plots.py 81.08% <100.00%> (ø)
ogcore/parameters.py 74.20% <100.00%> (+0.35%) ⬆️

@jdebacker
Copy link
Member Author

All unit tests are passing and I've run the example script successfully my my machine.

There is some issue building miniconda in the "Check that docs build" workflow. It continues to time out, even after re-running this job 3 times. I do not know the issue since the same actions are used to build miniconda here as are used in the successful unit test actions.

If @rickecon doesn't have a quick solution, I would say go ahead and merge this PR. It is otherwise ready to go.

environment.yml Outdated Show resolved Hide resolved
@rickecon
Copy link
Member

rickecon commented Sep 6, 2023

@jdebacker. All tests have passed except for Build and test [Python 3.9, 3.10] / build (ubuntu-latest, 3.9). Maybe we need to use mambaforge for our build_and_test.yaml.
OGcoreScreenshot

setup.py Outdated Show resolved Hide resolved
@rickecon
Copy link
Member

rickecon commented Sep 6, 2023

@jdebacker. We'll see how this goes. I am worried that we will run out of compute time with 9 build_and_test.yml matrix runs. If it times out, we can just remove Python 3.9 from the tests. Unfortunately, I don't know an easy way to do "local only" Python 3.11 tests.

@rickecon
Copy link
Member

rickecon commented Sep 6, 2023

@jdebacker. It looks like Python 3.11 is resulting in some pickle.load errors. Below is the traceback from the Build and test Linux Python 3.11 tests.

=========================== short test summary info ============================
ERROR tests/test_TPI.py - _pickle.UnpicklingError: Memo value not found at index 80
ERROR tests/test_output_plots.py - _pickle.UnpicklingError: Memo value not found at index 15776
ERROR tests/test_output_tables.py - _pickle.UnpicklingError: Memo value not found at index 15776
ERROR tests/test_parameter_plots.py - _pickle.UnpicklingError: Memo value not found at index 15776
ERROR tests/test_parameter_tables.py - _pickle.UnpicklingError: Memo value not found at index 15776

@rickecon
Copy link
Member

rickecon commented Sep 6, 2023

@jdebacker. The good news is that it ran really fast.

@jdebacker
Copy link
Member Author

@rickecon writes:

@jdebacker. It looks like Python 3.11 is resulting in some pickle.load errors. Below is the traceback from the Build and test Linux Python 3.11 tests.

Yes, if you save a pickle file in an earlier version of Python (or relevant packages that the pickled objects are from), it's difficult to open in a later version, as far as I know. We've run into this before. Since I don't want to save all pickle files again right now, I've just removed 3.11 from the test matrix.

@rickecon
Copy link
Member

rickecon commented Sep 6, 2023

Thanks @jdebacker. Looks great. Merging.

@rickecon
Copy link
Member

rickecon commented Sep 6, 2023

Oops. @jdebacker. We just need to update the version number in setup.py and ogcore/__init__.py. Probably bump it up to 0.10.8 rather than 0.11.0. Right?

@jdebacker
Copy link
Member Author

@rickecon Let me do a quick PR to resolve Issue #879 before we release a new version. We've got several changes we can package together. But yet, that will be 0.10.8.

@rickecon rickecon merged commit 2528e2b into PSLmodels:master Sep 6, 2023
8 checks passed
@jdebacker jdebacker deleted the fix_taxfunc_indexing branch September 7, 2023 00:32
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