Skip to content

Conversation

@iaugusty
Copy link
Collaborator

this PR is linked to
formatters PR insightsengineering/formatters#366
rlistings PR insightsengineering/rlistings#277

- update round_type = c("iec", "sas") to round_type = valid_round_type (introduced in formatters)
@github-actions
Copy link
Contributor

github-actions bot commented Nov 27, 2025

✅ All contributors have signed the CLA
Posted by the CLA Assistant Lite bot.

@iaugusty iaugusty requested a review from shajoezhu November 27, 2025 14:09
@iaugusty
Copy link
Collaborator Author

I have read the CLA Document and I hereby sign the CLA

max_width = max_width,
fontspec = fontspec,
ttype_ok = ttype_ok,
round_type = round_type
Copy link
Contributor

Choose a reason for hiding this comment

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

why not?

@github-actions
Copy link
Contributor

github-actions bot commented Nov 28, 2025

Unit Tests Summary

    1 files     29 suites   1m 53s ⏱️
  245 tests   245 ✅ 0 💤 0 ❌
1 805 runs  1 805 ✅ 0 💤 0 ❌

Results for commit 44970a0.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 28, 2025

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
Exporting to txt, pdf, rtf, and docx 💚 $12.65$ $-4.95$ $0$ $0$ $0$ $0$
Printing tables with proper round_type 👶 $+1.61$ $+57$ $0$ $0$ $0$
Tabulation framework 💔 $20.71$ $+3.21$ $0$ $0$ $0$ $0$
Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
Exporting to txt, pdf, rtf, and docx 💚 $4.16$ $-1.46$ export_as_pdf_works
Exporting to txt, pdf, rtf, and docx 💚 $2.95$ $-1.61$ exporting_pdf_does_the_inset
Printing tables with proper round_type 👶 $+0.02$ unnamed
Printing tables with proper round_type 👶 $+0.19$ round_type_can_be_set_on_basic_table
Printing tables with proper round_type 👶 $+0.19$ round_type_still_available_on_subtable
Printing tables with proper round_type 👶 $+0.36$ test_for_export_as_txt_with_argument_round_type
Printing tables with proper round_type 👶 $+0.06$ test_for_get_formatted_cells
Printing tables with proper round_type 👶 $+0.11$ test_for_matrix_form
Printing tables with proper round_type 👶 $+0.02$ test_for_obj_round_type_setter
Printing tables with proper round_type 👶 $+0.08$ test_for_round_type_and_tt_at_path
Printing tables with proper round_type 👶 $+0.02$ test_round_type_in_rrow_and_rrowl
Printing tables with proper round_type 👶 $+0.03$ test_round_type_in_rtable
Printing tables with proper round_type 👶 $+0.54$ toString_method_works_correctly_with_round_type_explicitely_passed_as_argument
Tabulation framework 💔 $9.88$ $+1.54$ qtable_works

Results for commit a9fa6c8

♻️ This comment has been updated with latest results.

@shajoezhu
Copy link
Collaborator

hi @iaugusty @nikolas-burkoff , can you take a look at this

@gmbecker
Copy link
Collaborator

gmbecker commented Nov 30, 2025

@shajoezhu I've pushed a fix for the broken test. It was from the new "default" format that has been added in the interim by the separate pr on formatters, nothing wrong with the code changes here.

@iaugusty please fix the documentation notes then roxygenize, and make sure the pkgdown builds ok (currently missing at least one topic, edit _pkgdown.yml to fix). Please check this before pushing for future PRs.

@github-actions
Copy link
Contributor

github-actions bot commented Nov 30, 2025

badge

Code Coverage Summary

Filename                     Stmts    Miss  Cover    Missing
-------------------------  -------  ------  -------  -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
R/00tabletrees.R               832      63  92.43%   20, 94, 97, 428, 519-520, 523, 681, 785, 877-878, 980, 983, 985-986, 1004-1007, 1027, 1142-1145, 1243-1248, 1411, 1512-1515, 1639-1642, 1679-1682, 1688-1693, 1753, 1760, 1856, 1968, 1981, 1984-1987, 1990-1993, 2023, 2056-2057
R/as_html.R                    172      25  85.47%   5-10, 80, 152-157, 162-167, 182-186, 273
R/colby_constructors.R         605      26  95.70%   81, 134, 197-200, 267-270, 411, 427, 1203, 1292, 1453, 1492, 1503, 1511, 1514, 1539, 1560, 1706, 1929-1932
R/compare_rtables.R             83      17  79.52%   93-96, 99-102, 115-118, 137, 156-157, 188, 193
R/custom_split_funs.R          265      40  84.91%   127, 132, 138-143, 156, 173-177, 353-358, 375-380, 456, 502, 518-521, 537, 599, 609-610, 612, 624, 668, 693
R/default_split_funs.R         287      22  92.33%   272, 335-338, 349-350, 352, 354, 551-555, 619-622, 685-688
R/format_rcell.R                17       1  94.12%   47
R/indent.R                      13       2  84.62%   40-41
R/index_footnotes.R             66       0  100.00%
R/make_split_fun.R             138      31  77.54%   22-26, 36-39, 52-55, 58-61, 115, 119, 267, 270-273, 278-281, 295, 366, 375, 377, 379, 430
R/make_subset_expr.R           137      15  89.05%   35, 47-61, 135-142, 178, 267, 271, 280
R/summary.R                    144      38  73.61%   35, 80, 178-220, 269, 315-331, 366, 397
R/tree_accessors.R            1275     148  88.39%   110, 139-140, 264, 284, 310, 333, 363, 381, 400-404, 424, 446-449, 564, 591-592, 878-884, 1028, 1047, 1073, 1125, 1182-1183, 1220, 1255, 1293-1298, 1357, 1431-1435, 1453-1462, 1540, 1660-1663, 1688, 1710-1711, 1721, 1772, 1793-1798, 1819-1824, 1835, 1909, 1950, 2049, 2156, 2169, 2183, 2199, 2208, 2218-2222, 2272-2277, 2480, 2490-2493, 2503, 2528-2531, 2538, 2540-2543, 2665, 2699-2700, 2757, 3061, 3422, 3538, 3572-3597, 3688-3696, 3857, 3931-3937, 4242, 4366, 4451-4456, 4462, 4486-4491, 4539, 4564-4588, 4617-4623
R/tt_afun_utils.R              419      33  92.12%   60, 182, 189, 198-212, 280, 288-289, 507, 515-518, 600-604, 624, 638-640
R/tt_as_df.R                   400      23  94.25%   101-104, 112, 150, 224-227, 369, 388, 458, 477-480, 489, 599, 605, 637, 655, 707
R/tt_compare_tables.R           72       4  94.44%   51, 174, 249, 253
R/tt_compatibility.R           574      70  87.80%   22, 149-150, 193, 198, 329-330, 334-337, 343, 347, 531, 585-588, 625-627, 665, 698, 718, 738-741, 751-754, 799, 816-820, 826-829, 903, 930-933, 942, 1004, 1012, 1023-1026, 1137, 1144, 1172-1186, 1217-1218
R/tt_dotabulation.R           1176      95  91.92%   60, 255, 260, 262, 311, 336, 340-343, 376-379, 402, 435-438, 466-469, 567, 709-713, 763, 767, 795-798, 808, 828-832, 839-842, 1106, 1110, 1141, 1245-1248, 1462-1470, 1734-1743, 1825-1828, 1839, 1844, 1849-1850, 1852, 1863, 1868, 1891, 1977-1996
R/tt_export.R                   13       1  92.31%   45
R/tt_from_df.R                  15       0  100.00%
R/tt_paginate.R                535      40  92.52%   74, 122-131, 243, 342-343, 495, 630-633, 654-658, 803-806, 857-864, 941, 944, 962, 969, 972
R/tt_pos_and_access.R          654      33  94.95%   76, 78-80, 105, 166, 262, 329, 438, 512, 516, 724, 726, 734, 740, 754, 764-767, 989, 1006-1009, 1036, 1095-1096, 1109, 1350-1351, 1377-1380, 1654, 1729
R/tt_showmethods.R             162      21  87.04%   56, 91-113, 223, 249, 258, 263, 266-270, 359-360
R/tt_sort.R                    115       6  94.78%   50, 289-292, 300
R/tt_toString.R                439      24  94.53%   125, 355, 377, 390, 400, 406, 409, 415-425, 518, 619, 826-851
R/utils.R                       34       7  79.41%   56, 169-174
R/validate_table_struct.R       84      10  88.10%   80-84, 93-94, 140, 149-150
R/Viewer.R                      61       9  85.25%   46, 50, 60-64, 84, 118
TOTAL                         8787     804  90.85%

Diff against main

Filename                  Stmts    Miss  Cover
----------------------  -------  ------  -------
R/00tabletrees.R            +20       0  +0.19%
R/colby_constructors.R       +2       0  +0.01%
R/format_rcell.R             +4      +1  -5.88%
R/tree_accessors.R          +19      +1  +0.10%
R/tt_afun_utils.R            +2       0  +0.04%
R/tt_compatibility.R         +4       0  +0.09%
R/tt_dotabulation.R          +2       0  +0.01%
TOTAL                       +53      +2  +0.03%

Results for commit: 44970a0

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@shajoezhu
Copy link
Collaborator

hi @gmbecker , yes, i tested downstream in scda.test and ran it as a whole cohort for formatters, rtables and rlistings, all working. thanks a lot for the changes

can you please update the news, we can merge these now. no blockers from my side. thank you

@nikolas-burkoff
Copy link
Collaborator

@shajoezhu @gmbecker can I be added as a collaborator to insights engineering?
What's the process for this to happen? Happy to sign up to/agree with rules for collaboration

Thanks

@iaugusty
Copy link
Collaborator Author

iaugusty commented Dec 1, 2025

all checks passed, I hope we are good to go

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.

downstream all good! insightsengineering/scda.test#201 thanks guys!

please update description after formatters pr is merged in

@shajoezhu
Copy link
Collaborator

@shajoezhu @gmbecker can I be added as a collaborator to insights engineering? What's the process for this to happen? Happy to sign up to/agree with rules for collaboration

Thanks

hi @nikolas-burkoff , there is an invite on your way, you will have access to formatters/rlistings/rtables/tern/scda.test, let me know if problem. thanks!

@nikolas-burkoff
Copy link
Collaborator

Thanks @shajoezhu - the invite is asking me to authenticate with a single sign on with Roche credentials (which I don't have).
I'll have to go through the same route for access as @iaugusty

@shajoezhu
Copy link
Collaborator

Thanks @shajoezhu - the invite is asking me to authenticate with a single sign on with Roche credentials (which I don't have). I'll have to go through the same route for access as @iaugusty

hi @nikolas-burkoff , can we set a call and you can show me what you see, my email is joe.zhu@roche.com, thanks!

Copy link
Collaborator

@gmbecker gmbecker left a comment

Choose a reason for hiding this comment

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

Overall looks good a few more tests to add

})


test_that("toString method works correctly with user defined round_type", {
Copy link
Collaborator

Choose a reason for hiding this comment

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

reword this, user is setting round_type but not defining a new one

txtvals_iec <- vals_round_type_fmt(vals = vals_round_type, round_type = "iec")
txtvals_sas <- vals_round_type_fmt(vals = vals_round_type, round_type = "sas")

# confirm that at least one value is different
Copy link
Collaborator

Choose a reason for hiding this comment

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

update comment to be more explicit about expected behavior (first two different third same)

df_iec2
)


Copy link
Collaborator

Choose a reason for hiding this comment

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

Add testing for explicit calls to export_as_txt

mpf <- matrix_form(tbl_sas)

expect_identical(
mpf$round_type,
Copy link
Collaborator

Choose a reason for hiding this comment

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

use the accessor here and elsewhere

})

test_that("test for obj_round_type setter", {
skip_if_not_installed("dplyr")
Copy link
Collaborator

Choose a reason for hiding this comment

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

I dont' think we use dplyr here?

rep("iec", 3)
)

gkids <- tree_children(kids[[1]])
Copy link
Collaborator

Choose a reason for hiding this comment

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

make a function which checks the children then we can call it here and below

exp_str_sas
)
})

Copy link
Collaborator

Choose a reason for hiding this comment

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

Add tests for overriding round type in toString/export_as_txt

toString(..., round_type = "iec_mod")

Add test for matrix_form method (make sure it ends up with the right round_type)

@iaugusty
Copy link
Collaborator Author

iaugusty commented Dec 4, 2025

@gmbecker All your comments have been addressed in updated tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

allow table objects to have round_type instead of needing to specify on export

6 participants