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

use rtables pkg function for generating report #265

Merged
merged 17 commits into from
May 16, 2024

Conversation

kartikeyakirar
Copy link
Contributor

@kartikeyakirar kartikeyakirar commented Mar 15, 2024

partially fixes :#258

  • using rtables pkg functions instead of creating new functions from flextable.
  • fixing width issue.

feasibility to remove any call from flextable pkg and remove it from import

@kartikeyakirar kartikeyakirar marked this pull request as draft March 15, 2024 11:59
Copy link
Contributor

github-actions bot commented Mar 15, 2024

badge

Code Coverage Summary

Filename                  Stmts    Miss  Cover    Missing
----------------------  -------  ------  -------  -----------------------------------------------------------------------------------------------------
R/AddCardModule.R           146       2  98.63%   170, 207
R/ContentBlock.R             18       2  88.89%   57-63
R/DownloadModule.R          238      67  71.85%   98-104, 152, 183-188, 197-202, 205-210, 219-224, 227-232, 240-245, 248-253, 260-265, 268-273, 312-316
R/FileBlock.R                13       0  100.00%
R/LoadReporterModule.R      103      19  81.55%   100-105, 108-113, 119-124, 136
R/NewpageBlock.R              2       0  100.00%
R/PictureBlock.R             30       2  93.33%   20, 118
R/Previewer.R               372      95  74.46%   96-98, 101-102, 184-213, 217-219, 222, 289, 304, 306-309, 312, 315-323, 437-481
R/RcodeBlock.R               15       0  100.00%
R/Renderer.R                113      37  67.26%   97-112, 216, 224, 233, 235-256
R/ReportCard.R               84       3  96.43%   236, 241, 266
R/Reporter.R                107       6  94.39%   273-278
R/ResetModule.R              53       0  100.00%
R/SimpleReporter.R           32       0  100.00%
R/TableBlock.R                9       0  100.00%
R/TextBlock.R                13       0  100.00%
R/utils.R                   126      86  31.75%   7, 38-97, 99, 102-109, 137, 161-169, 206-215
R/yaml_utils.R               81       2  97.53%   78, 289
R/zzz.R                      14      10  28.57%   2-13, 19
TOTAL                      1569     331  78.90%

Diff against main

Filename      Stmts    Miss  Cover
----------  -------  ------  -------
R/utils.R       -45      +6  -21.47%
TOTAL           -45      +6  -0.96%

Results for commit: d493bd8

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

Copy link
Contributor

github-actions bot commented Mar 15, 2024

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
Renderer 💔 $0.85$ $+2.64$ $0$ $0$ $0$ $0$
ReportCard 💔 $0.97$ $+4.19$ $0$ $0$ $0$ $0$
Reporter 💔 $1.80$ $+1.92$ $0$ $0$ $0$ $0$
TableBlock 💔 $1.32$ $+13.68$ $0$ $0$ $0$ $0$
utils 💔 $0.50$ $+4.38$ $-3$ $0$ $0$ $0$
Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
Renderer 💔 $0.38$ $+2.61$ renderRmd_asserts_the_argument_is_a_list_of_TextBlocks_PictureBlock_NewpageBlock_TableBlock
ReportCard 💔 $0.24$ $+2.19$ append_table_accepts_a_data.frame
ReportCard 💔 $0.21$ $+2.03$ append_table_returns_self
Reporter 💔 $1.55$ $+1.91$ default_reporter_id
TableBlock 💔 $0.19$ $+2.32$ from_list_after_to_list_to_save_and_retrive
TableBlock 💔 $0.19$ $+2.18$ set_content_accepts_a_table_object
TableBlock 💔 $0.18$ $+2.28$ set_content_returns_the_TableBlock_object
TableBlock 💔 $0.18$ $+2.33$ set_content_supports_data.frame_object
TableBlock 💔 $0.19$ $+2.29$ to_list_returns_a_named_list_with_a_one_field_a_proper_file_name
TableBlock 💔 $0.18$ $+2.30$ to_list_returns_a_named_list_with_a_one_field_a_proper_path
utils 💀 $0.15$ $-0.15$ custom_theme_to_flextable
utils 💀 $0.00$ $-0.00$ get_merge_index
utils 💀 $0.00$ $-0.00$ get_merge_index_single
utils 💀 $0.15$ $-0.15$ merge_at_indice
utils 💀 $0.15$ $-0.15$ padding_lst_applies_padding_to_a_flextable_based_on_indentation_levels
utils 💀 $0.03$ $-0.03$ to_flextable_supported_class
utils 👶 $+0.13$ to_flextable_supported_class_data.frame_
utils 👶 $+4.61$ to_flextable_supported_class_listing_df_
utils 👶 $+0.12$ to_flextable_supported_class_rtables_

Results for commit 5314ea5

♻️ This comment has been updated with latest results.

@Melkiades Melkiades self-assigned this Mar 18, 2024
DESCRIPTION Show resolved Hide resolved
R/utils.R Outdated Show resolved Hide resolved
Copy link
Contributor

github-actions bot commented May 14, 2024

CLA Assistant Lite bot ✅ All contributors have signed the CLA

@Melkiades
Copy link
Contributor

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

@Melkiades
Copy link
Contributor

@kartikeyakirar, how is this going? I think it is kind of ready isnt it? ^^

@kartikeyakirar
Copy link
Contributor Author

kartikeyakirar commented May 14, 2024

@Melkiades, I had paused work on this due to sprint priorities but have now resumed. The issue was addressed in the PR. We discussed the possibility of removing any calls to the flextable package and eliminating it from our imports. As a result, I've moved this to draft and am actively working on it.

Feasibility to remove any call from flextable pkg and remove it from import

I think i should have merged this and created a separate issue to remove flextable, to maintain momentum.

@kartikeyakirar
Copy link
Contributor Author

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

@Melkiades
Copy link
Contributor

@Melkiades, I had paused work on this due to sprint priorities but have now resumed. The issue was addressed in the PR. We discussed the possibility of removing any calls to the flextable package and eliminating it from our imports. As a result, I've moved this to draft and am actively working on it.

Feasibility to remove any call from flextable pkg and remove it from import

I think i should have merged this and created a separate issue to remove flextable, to maintain momentum.

It is anyway imported by rtables function so I do not think it will make a lot of a difference

@kartikeyakirar kartikeyakirar marked this pull request as ready for review May 15, 2024 11:51
@kartikeyakirar kartikeyakirar requested a review from Melkiades May 15, 2024 11:51
Copy link
Contributor

github-actions bot commented May 15, 2024

Unit Tests Summary

  1 files   18 suites   37s ⏱️
189 tests 189 ✅ 0 💤 0 ❌
329 runs  329 ✅ 0 💤 0 ❌

Results for commit d493bd8.

♻️ This comment has been updated with latest results.

R/utils.R Outdated Show resolved Hide resolved
R/utils.R Show resolved Hide resolved
R/utils.R Show resolved Hide resolved
@kartikeyakirar kartikeyakirar requested a review from Melkiades May 15, 2024 16:29
Copy link
Contributor

@Melkiades Melkiades left a comment

Choose a reason for hiding this comment

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

It looks good to me. Only could you reinstate some tests for the functionality anyway? something simple ofc. Thank you very much Kartik!!

@kartikeyakirar
Copy link
Contributor Author

some tests for the functionality anyway?

done 800d071

@kartikeyakirar kartikeyakirar enabled auto-merge (squash) May 16, 2024 13:33
@kartikeyakirar kartikeyakirar merged commit 2d66b49 into main May 16, 2024
28 of 29 checks passed
@kartikeyakirar kartikeyakirar deleted the 258_fix_table_cutoff branch May 16, 2024 13:48
@github-actions github-actions bot locked and limited conversation to collaborators May 16, 2024
rtables::main_footer(ft) <- mf$main_footer
rtables::prov_footer(ft) <- mf$prov_footer
rtables::header_section_div(ft) <- mf$header_section_div
ft <- rtables::tt_to_flextable(ft, total_width = c(grDevices::pdf.options()$width - 1))
Copy link
Contributor

Choose a reason for hiding this comment

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

@kartikeyakirar if there is an issue with the width could be coming from here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the size is too large, and any width adjustment cannot handle it. Please check the table #274 (comment). We need to break the table with similar functions as export_as_pdf.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants