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 parameter error parsing in taxcalcio module #2625

Merged
merged 2 commits into from
Sep 29, 2021

Conversation

hdoupe
Copy link
Collaborator

@hdoupe hdoupe commented Sep 23, 2021

Resolves #2622.

@@ -689,11 +689,11 @@ def num_years(self):

@property
def parameter_warnings(self):
return self.errors or ""
return self.errors or {}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The parameter errors are a dictionary that looks like this:

{'AMEDT_rt': ['AMEDT_rt[year=2021] 1.8 > max 1 ']}

This change sets the default value to be a dictionary to keep the type consistent.

@codecov
Copy link

codecov bot commented Sep 23, 2021

Codecov Report

Merging #2625 (a634b67) into master (787155e) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2625   +/-   ##
=======================================
  Coverage   98.46%   98.47%           
=======================================
  Files          14       14           
  Lines        2611     2615    +4     
=======================================
+ Hits         2571     2575    +4     
  Misses         40       40           
Flag Coverage Δ
unittests 98.47% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
taxcalc/parameters.py 99.31% <100.00%> (ø)
taxcalc/taxcalcio.py 100.00% <100.00%> (ø)

@jdebacker
Copy link
Member

@hdoupe Looks very good and I was able to run all tests locally, plus get the proper error message from the json file given in Issue #2621.

But before merging, can you get that new line of code covered? I think it just involves passing a reform file to the baseline argument in the new test you wrote, which does catch all the new lines for the reform file error messages.

Thanks for your work on this!

@hdoupe
Copy link
Collaborator Author

hdoupe commented Sep 29, 2021

@jdebacker Looks like the code coverage test is passing now! Thanks for reviewing this.

@jdebacker
Copy link
Member

@hdoupe Thanks for getting that line covered -- and for the PR. Merging.

@jdebacker jdebacker merged commit b4c2361 into PSLmodels:master Sep 29, 2021
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.

Handling ParamTools error messages
2 participants