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

Add when validator for year parameter #177

Merged
merged 2 commits into from
Apr 4, 2021

Conversation

hdoupe
Copy link
Collaborator

@hdoupe hdoupe commented Apr 2, 2021

  • Adds the when validator that @jdebacker set up in update start year for CS Cost-of-Capital-Calculator#344.
  • Extends the dump method for meta parameters to use the choice validator so that C/S will still show the dropdown for the year meta parameter even though it is actually using the when validator. This is necessary until C/S adds support for the when validator in the GUI.

Resolves #176

@hdoupe
Copy link
Collaborator Author

hdoupe commented Apr 2, 2021

Sorry, accidentally formatted the entire test_functions.py file.

@hdoupe
Copy link
Collaborator Author

hdoupe commented Apr 2, 2021

Well, validation works:

>           raise self.validation_error
E           paramtools.exceptions.ValidationError: {
E               "errors": {
E                   "year": [
E                       "When data_source is equal to CPS, year value is invalid: year 2013 < min 2014 "
E                   ]
E               }
E           }

The grid logic for testing get_inputs with all combinations of meta parameters doesn't handle the when validator correctly. I'm inclined to skip this test or input configuration somehow so this doesn't hold things up, but I'll think about this some more.

@hdoupe hdoupe merged commit 96363f7 into PSLmodels:master Apr 4, 2021
@hdoupe hdoupe deleted the fix-start-year branch April 4, 2021 15:01
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.

Compute Studio Start Year Values
1 participant