-
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
support length 1 arrays and relative metrics #11
Conversation
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.
the bulk of this code was previously in test-generate_eval_data.R
. It's been moved to this separate helper-*.R
file, with some minor updates around the include_rel
parameter.
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.
Per my suggestion in hubverse-org/hubEvals#69 (review), I would recommend saving these outputs as test fixtures instead of generating them when the tests are run. From the looks of it, you only need to generate the tables for the relative metrics and subset them to the columns without relative metrics.
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.
unfortunately the git diff for this file is useless, diff got confused. For this test file, there are three changes:
- deleted
check_exp_scores_for_window
function (this moved to separate R script) - Added ", no relative metrics" to the description of the first test case, no changes to the test itself.
- Added a second test case with relative metrics. This is a near-duplicate of the first test case, but it refers to a config file that includes relative metrics and asks
check_exp_scores_for_window
to include relative metric results.
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 okay to me with the exception of the test helper, as noted in my comment below.
Regarding this comment:
update the schema to support length 1 arrays. I'm not sure if this is a core thing about YAML or just some behavior in the R packages we're using to read and validate the data structures -- but it seems like to get validations to pass in the case of arrays of strings with length 1, we need to say that valid entries may be either strings or arrays of strings. Added this to the schema and some test cases.
This is partially a symptom of jsonlite and partially a symptom of the yaml package. Both have their weird idiosyncrasies and something always gets lost in translation. I think your solution is a good workaround.
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.
Per my suggestion in hubverse-org/hubEvals#69 (review), I would recommend saving these outputs as test fixtures instead of generating them when the tests are run. From the looks of it, you only need to generate the tables for the relative metrics and subset them to the columns without relative metrics.
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! I have one minor suggestion to remove calls to library()
, but otherwise this looks good!
Co-authored-by: Zhian N. Kamvar <[email protected]>
I tried removing the |
Yeah, that's a leaky abstraction and definitely not worth it. I'm a little surprised that |
Two distinct sets of updates here:
relative_metrics
andbaseline
as properties of target entries