1095 intermediate nesting - #1111
Conversation
…1095_intermediate_nesting
…1109) - Redocument using the up to date roxygen 8.0.0 (reverting most of the changes) - Added tests for `at_sibling` - Fixed multivariable label validation and made cut-split labels visible only for `at_sibling` branches. --------- Signed-off-by: David Muñoz Tord <david.munoztord@mailbox.org> Co-authored-by: Joe Zhu <joe.zhu@roche.com> Co-authored-by: shajoezhu <3692541+shajoezhu@users.noreply.github.com>
…1095_intermediate_nesting
|
@munoztd0 I've moved your tests to test-nesting.R along with the ones I had locally, can you please convert the ones you have to use the |
Code Coverage SummaryDiff against mainResults for commit: 7814d28 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
…verse/rtables into 1095_intermediate_nesting
Unit Tests Summary 1 files 32 suites 2m 3s ⏱️ Results for commit 7814d28. ♻️ This comment has been updated with latest results. |
Unit Test Performance Difference
Additional test case details
Results for commit d7f2423 ♻️ This comment has been updated with latest results. |
Co-authored-by: shajoezhu <3692541+shajoezhu@users.noreply.github.com>
Co-authored-by: shajoezhu <3692541+shajoezhu@users.noreply.github.com>
munoztd0
left a comment
There was a problem hiding this comment.
finished last tweaks and adress comments
Of course just launched the PR -> insightsengineering/scda.test#245 |
Melkiades
left a comment
There was a problem hiding this comment.
Nice work, the at_sibling feature does what #1095 asked and the happy path is solid. Verified it builds correctly and the moved column-nesting test still checks out. A couple of real bugs on the error paths though, plus some cleanup. Comments inline.
| sib_matches <- is.null(at_sibling) || at_sibling == first_spl_name(lastel) | ||
| if (endontree && sib_matches) { | ||
| splvec[[branch_pos]] <- SplitVectorTree(lst = c(lastel, list(SplitVector(newspl)))) | ||
| } else if (has_force_pag(lastel)) { |
There was a problem hiding this comment.
This crashes on the exact case the docs say is unsupported. If at_sibling targets something that was itself placed with at_sibling, lastel is a SplitVectorTree and has_force_pag has no method for that class, so you get an internal dispatch error instead of the informative message.
basic_table() |>
split_rows_by("STRATA1") |>
split_rows_by("SEX") |> analyze("AGE") |>
split_rows_by("RACE", at_sibling = "SEX") |> analyze("AGE") |>
split_rows_by("BMRKR2", at_sibling = "RACE") |> analyze("AGE") |>
build_table(ex_adsl)
#> unable to find an inherited method for 'has_force_pag' for signature 'SplitVectorTree'Needs an up-front guard with the documented error, or a has_force_pag method for SplitVectorTree. Worth a test too.
| alt_df = alt_df, | ||
| alt_df_full = alt_df_full, | ||
| splvec = splvecii, | ||
| name = obj_name(unlist(splvecii, recursive = TRUE)[[1]]), ## XXX I think this is wrong |
There was a problem hiding this comment.
These XXX markers are in the tabulation core (name= here, no_outer_tbl = TRUE just below and at 1245). Since this drives the actual table build, can we resolve them or pin the assumption with a test rather than shipping the uncertainty?
Intermediate nesting behavior, testing and documentation