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

Catching errors for mismatches in alt_counts_df splits #721

Merged
merged 18 commits into from
Aug 29, 2023

Conversation

Melkiades
Copy link
Contributor

Fixes #720

@Melkiades Melkiades added bug automation tests Something they are concerned to sme labels Aug 23, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Aug 23, 2023

badge

Code Coverage Summary

Filename                     Stmts    Miss  Cover    Missing
-------------------------  -------  ------  -------  ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
R/00tabletrees.R               662      46  93.05%   24, 94, 96, 371, 447-448, 451, 590, 681, 763-764, 854, 856-857, 880-881, 901, 1080-1083, 1214, 1298-1299, 1358-1361, 1394-1395, 1401-1406, 1449, 1455, 1544, 1636, 1647, 1649-1650, 1653-1654, 1682, 1708-1709
R/as_html.R                     88       7  92.05%   7-12, 68
R/colby_constructors.R         489      17  96.52%   63, 106-107, 155-156, 202-203, 328, 341, 1107, 1184, 1327, 1363, 1382, 1402, 1421, 1568
R/compare_rtables.R             78      11  85.90%   95-96, 99-100, 113-114, 131, 150-151, 181, 185
R/format_rcell.R                12       0  100.00%
R/indent.R                      13       2  84.62%   39-40
R/index_footnotes.R             52       0  100.00%
R/make_split_fun.R              97      15  84.54%   22-25, 48-49, 51-52, 103, 106, 252, 254-255, 259-260, 276, 366
R/make_subset_expr.R           108      12  88.89%   26-35, 93-98, 131, 200, 211, 218
R/simple_analysis.R              5       1  80.00%   48
R/split_funs.R                 430      52  87.91%   131, 135, 140-145, 149, 165-167, 327-330, 346-351, 421, 461, 475-476, 490, 546, 555-556, 558, 570, 610, 630, 789, 796, 821-822, 830-831, 833-834, 992-993, 1004-1007, 1070-1071, 1127-1128
R/summary.R                    187      20  89.30%   40, 84, 188, 195, 260-263, 273-274, 293-294, 399, 453-457, 485, 513
R/tree_accessors.R             802      74  90.77%   93, 210, 223, 240, 271, 281, 293, 385, 407-408, 662-666, 774, 788, 805, 846, 900-901, 933, 959, 991-995, 1042, 1104-1106, 1120, 1186, 1272-1273, 1291, 1305-1306, 1314, 1344, 1357-1360, 1378-1381, 1445, 1483, 1573, 1651, 1661, 1671, 1680, 1686, 1692-1695, 1973, 2267, 2361, 2443-2449, 2593, 2692, 2715-2743, 2755-2760
R/tt_afun_utils.R              345      25  92.75%   44, 150, 156, 164-173, 222, 233-234, 456, 463-464, 528-530, 549, 563-564
R/tt_compare_tables.R           65       4  93.85%   56, 170, 248, 251
R/tt_compatibility.R           442      48  89.14%   19, 137-138, 187, 191, 321-322, 325-328, 335, 338, 382, 498, 540, 569, 587, 611-612, 652, 665-667, 736, 761-764, 773, 825, 831, 838-839, 943, 949, 975-987, 1016-1017
R/tt_dotabulation.R            963      67  93.04%   47, 236, 238, 283, 305, 308-309, 356, 388-389, 417-418, 502, 627-629, 678, 681, 707-709, 718, 735-737, 742-743, 971, 974, 1001, 1112-1113, 1280-1284, 1381, 1475-1483, 1549-1552, 1563, 1567, 1572-1574, 1584, 1588, 1610, 1697-1711
R/tt_export.R                  202      36  82.18%   47, 63, 104-105, 136, 175-177, 233-246, 398-399, 405, 448-454, 458-460, 556-557, 569
R/tt_from_df.R                   9       0  100.00%
R/tt_paginate.R                382      26  93.19%   47, 69, 100-105, 355, 456-457, 474-476, 619-620, 664-669, 733, 735, 744, 750, 753
R/tt_pos_and_access.R          519      37  92.87%   73, 75-76, 100, 152, 187-189, 234, 471, 473, 480, 486, 499, 508-509, 673, 684-686, 692-695, 723, 765-766, 776, 927-928, 976-1000, 1224, 1294
R/tt_showmethods.R             121      20  83.47%   47, 73-87, 138, 154-157, 163, 170, 172-174, 252-253
R/tt_sort.R                     76       3  96.05%   211-212, 218
R/tt_toString.R                325      23  92.92%   112, 305, 318, 327, 334, 336, 342-352, 435, 489, 495, 704-729
R/utils.R                       23       0  100.00%
R/validate_table_struct.R       75      11  85.33%   76-79, 88-89, 129, 137-138, 191-192
R/Viewer.R                      56       9  83.93%   51, 55, 65-68, 87-88, 118
TOTAL                         6626     566  91.46%

Diff against main

Filename                     Stmts    Miss  Cover
-------------------------  -------  ------  --------
R/00tabletrees.R               +38      +5  -0.38%
R/colby_constructors.R          +7       0  +0.05%
R/index_footnotes.R             +2       0  +100.00%
R/make_split_fun.R             +97     +15  +84.54%
R/make_subset_expr.R            +2       0  +0.21%
R/split_funs.R                  +9      -3  +0.97%
R/summary.R                     +4      +4  -1.95%
R/tree_accessors.R              +9      +6  -0.65%
R/tt_compatibility.R           +29      -2  +1.25%
R/tt_dotabulation.R           +226     +23  -0.99%
R/tt_export.R                  -27     -37  +14.06%
R/tt_paginate.R                 -1     +11  -2.89%
R/tt_pos_and_access.R           -1       0  -0.01%
R/tt_showmethods.R               0      -1  +0.83%
R/tt_sort.R                     -5      -3  +3.46%
R/tt_toString.R                +20      +1  +0.14%
R/utils.R                      +12      -1  +9.09%
R/validate_table_struct.R      +75     +11  +85.33%
TOTAL                         +496     +29  +0.22%

Results for commit: ef4c6c2

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@github-actions
Copy link
Contributor

github-actions bot commented Aug 23, 2023

Unit Tests Summary

       1 files       24 suites   1m 57s ⏱️
   182 tests    182 ✔️ 0 💤 0
1 392 runs  1 392 ✔️ 0 💤 0

Results for commit a154544.

♻️ This comment has been updated with latest results.

R/tt_dotabulation.R Outdated Show resolved Hide resolved
@Melkiades
Copy link
Contributor Author

@gmbecker @shajoezhu, I think this is important to get in before CRAN release

@Melkiades Melkiades mentioned this pull request Aug 23, 2023
19 tasks
Copy link
Collaborator

@shajoezhu shajoezhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hi @Melkiades thanks for the change, it looks much better

i am getting more informative errors now

Error in .local(spl, have_controws, make_lrow, ...) :
alt_counts_df split variable(s) [ARMCD] (in split VarLevelSplit) has not the same factor levels of df.
df has c(ARM A, ARM B, ARM C) levels while alt_counts_df has c()

can you add quotes to the arms, so it appears like c("ARM A", "ARM B", "ARM C")

Thanks a lot

@Melkiades Melkiades dismissed gmbecker’s stale review August 28, 2023 15:00

To have it merge in, so it is stable

@shajoezhu
Copy link
Collaborator

hi @Melkiades , thanks for the change

looks better, but still need change. I am getting

Error in .local(spl, have_controws, make_lrow, ...) :
alt_counts_df split variable(s) [ARMCD] (in split VarLevelSplit) has not the same factor levels of df.
df has c("ARM A", "ARM B", "ARM C") levels while alt_counts_df has c("NA")
> levels(DM_tmp$ARMCD)
NULL

c("NA") is not right in this case

@Melkiades
Copy link
Contributor Author

hi @Melkiades , thanks for the change

looks better, but still need change. I am getting

Error in .local(spl, have_controws, make_lrow, ...) :
alt_counts_df split variable(s) [ARMCD] (in split VarLevelSplit) has not the same factor levels of df.
df has c("ARM A", "ARM B", "ARM C") levels while alt_counts_df has c("NA")
> levels(DM_tmp$ARMCD)
NULL

c("NA") is not right in this case

it is not a factor, so it has no levels

R/tt_dotabulation.R Outdated Show resolved Hide resolved
Copy link
Collaborator

@shajoezhu shajoezhu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! thanks @Melkiades for the change and adding the additional test cases

Melkiades and others added 2 commits August 29, 2023 23:21
Co-authored-by: Joe Zhu <joe.zhu@roche.com>
Signed-off-by: Davide Garolini <dgarolini@gmail.com>
@Melkiades Melkiades merged commit 7c23ddf into main Aug 29, 2023
7 of 11 checks passed
@Melkiades Melkiades deleted the 720_alt_df_bug_diff_splits@main branch August 29, 2023 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation bug sme tests Something they are concerned to
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Possible bug for alt_counts_df split by NA_character_ or different number of levels
3 participants