-
Notifications
You must be signed in to change notification settings - Fork 0
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
Refactor validation tests #47
Conversation
…ia transform functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. I made my notes below and a couple of broad observations:
- I would turn the warning into an error. Warnings are a weird sort of alert in R. Messages inform the user of processes that are going on and Errors tell the user that something is wrong. Warnings are a way of telling the user that something is weird and maybe wrong, but it shows up after the damage has been done.
- It's not a bad idea to test for the same error/warning in multiple places
- just a small note for testing errors: if it comes from another package, we may run into issues in the future if error messages change.
Co-authored-by: Zhian N. Kamvar <zkamvar@gmail.com>
Co-authored-by: Zhian N. Kamvar <zkamvar@gmail.com>
Co-authored-by: Zhian N. Kamvar <zkamvar@gmail.com>
Co-authored-by: Zhian N. Kamvar <zkamvar@gmail.com>
Co-authored-by: Zhian N. Kamvar <zkamvar@gmail.com>
Co-authored-by: Zhian N. Kamvar <zkamvar@gmail.com>
Co-authored-by: Zhian N. Kamvar <zkamvar@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the changes. There is still linting, but I guarantee that's my fault (I litter whitespace at the end of lines)
Thanks for the constructive review! I'll merge this now. |
In #41, we refactored some validations that were duplicated in
transform_point_model_out
andtransform_quantile_model_out
into a new/separate function,validate_model_out_target_obs
that is called from each of those transform functions.The main purpose of this PR is to tidy up the unit tests in an analogous way, so that tests of the transform functions that were really about those validation checks how just test the validation function instead. This reduces some duplication in tests.
Along the way I found a couple of errors in test setup which I have also fixed, and also added another check to
validate_model_out_target_obs
.