metrumresearchgroup / bbr

R interface for model and project management
https://metrumresearchgroup.github.io/bbr/
Other
23 stars 2 forks source link

summary_log: adjust extract_details for tidyr 1.3.0 compatibility #572

Closed kyleam closed 1 year ago

kyleam commented 1 year ago

With the recent tidyr 1.3.0 release, two summary log tests are failing:

Error ('test-summary-log.R:81'): summary_log() parses heuristics correctly [BBR-SMLG-006]
Error in `unnest_wider(., "d")`: ℹ In column: `d`.
ℹ In row: 4.
Caused by error:
! Can't unnest elements with missing names.
ℹ Supply `names_sep` to generate automatic names.

Error ('test-summary-log.R:96'): summary_log() parses more complex flags and stats [BBR-SMLG-007]
Error in `unnest_wider(., "d")`: ℹ In column: `d`.
ℹ In row: 4.
Caused by error:
! Can't unnest elements with missing names.
ℹ Supply `names_sep` to generate automatic names.

The value triggering these failures looks like this:

$<NA>
NULL

$problem_text
[1] "PK model 1 cmt base"

$number_of_subjects
[1] 40

$number_of_obs
[1] 760

That NA comes from extract_details() indexing the run details with DETAILS_ELEMENTS, which includes "estimation_method", but the value for the acop-onlysim model doesn't have an estimation_method element.

Handle this case by only indexing with names that exist for a given model's run details.


cc @seth127 for awareness

kyleam commented 1 year ago

Here's a CI build that is running with the latest tidyr (i.e. the build that would fail before this commit): https://github-drone.metrumrg.com/metrumresearchgroup/bbr/3401/3/5

I'll push a scratch build off of main to demonstrate the failure (hopefully). I believe a vignette will be failing too.

Update: here it is. It's just the vignette failure because it doesn't proceed to running the tests, but that works for showing the issue.

kyleam commented 1 year ago

@barrettk Thanks for taking a look.