Skip to content

Conversation

@averissimo
Copy link
Contributor

@averissimo averissimo commented Jun 3, 2025

@averissimo averissimo marked this pull request as ready for review June 5, 2025 13:11
@github-actions
Copy link
Contributor

github-actions bot commented Jun 5, 2025

badge

Code Coverage Summary

Filename                      Stmts    Miss  Cover    Missing
--------------------------  -------  ------  -------  -------------------------------------------
R/tm_a_pca.R                    876     876  0.00%    141-1147
R/tm_a_regression.R             762     762  0.00%    180-1041
R/tm_data_table.R               200     200  0.00%    100-348
R/tm_file_viewer.R              172     172  0.00%    47-254
R/tm_front_page.R               143     132  7.69%    77-246
R/tm_g_association.R            331     331  0.00%    161-561
R/tm_g_bivariate.R              685     421  38.54%   332-805, 846, 957, 974, 992, 1003-1025
R/tm_g_distribution.R          1116    1116  0.00%    154-1414
R/tm_g_response.R               356     356  0.00%    179-608
R/tm_g_scatterplot.R            720     720  0.00%    261-1079
R/tm_g_scatterplotmatrix.R      283     264  6.71%    200-515, 576, 590
R/tm_missing_data.R            1099    1099  0.00%    124-1403
R/tm_outliers.R                1032    1032  0.00%    163-1348
R/tm_t_crosstable.R             273     273  0.00%    177-494
R/tm_variable_browser.R         788     783  0.63%    89-1025, 1063-1246
R/utils.R                       183     120  34.43%   87-249, 278-304, 316-325, 330, 344-363, 448
R/zzz.R                           2       2  0.00%    2-3
TOTAL                          9021    8659  4.01%

Diff against main

Filename                      Stmts    Miss  Cover
--------------------------  -------  ------  --------
R/tm_a_pca.R                    -13     -13  +100.00%
R/tm_a_regression.R              -9      -9  +100.00%
R/tm_g_association.R            -14     -14  +100.00%
R/tm_g_bivariate.R              -14     -14  +0.77%
R/tm_g_distribution.R            -2      -2  +100.00%
R/tm_g_response.R               -14     -14  +100.00%
R/tm_g_scatterplot.R            -15     -15  +100.00%
R/tm_g_scatterplotmatrix.R      -15     -15  +0.34%
R/tm_missing_data.R             -20     -20  +100.00%
R/tm_outliers.R                 -23     -23  +100.00%
R/tm_t_crosstable.R             -13     -13  +100.00%
R/tm_variable_browser.R         -15     -15  +0.01%
R/utils.R                       +39      -8  +23.32%
TOTAL                          -128    -175  +0.57%

Results for commit: e48b58a

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@github-actions
Copy link
Contributor

github-actions bot commented Jun 5, 2025

Unit Tests Summary

  1 files  23 suites   2s ⏱️
151 tests 36 ✅ 115 💤 0 ❌
194 runs  79 ✅ 115 💤 0 ❌

Results for commit e48b58a.

♻️ This comment has been updated with latest results.

m7pr and others added 2 commits June 6, 2025 14:26
Companion to
insightsengineering/teal.reporter#334
Consequence of changing naming convention for `teal_report` object.

---------

Co-authored-by: André Veríssimo <[email protected]>
averissimo added a commit to insightsengineering/teal.code that referenced this pull request Jun 12, 2025
…l_data` (#255)

# Pull Request

Fixes:

- insightsengineering/teal#1526

Built on top of:

- insightsengineering/teal.reporter#307
    - _(#307 will be closed once this PR is stable)_

### Companion PRs:

- insightsengineering/teal#1541
- #255
- insightsengineering/teal.data#370
- insightsengineering/teal.reporter#331
- insightsengineering/teal.modules.general#884

### Changes description

- [x] Add new parameter `cache`
- Caches the result of the last evaluation in the respective `@code`
slot
    - [ ] Decide on name
- [x] Remove signature with multiple arguments to allow overriding
`eval_code` in other packages without showing a note

``` r
pkgload::load_all("teal.code")
#> ℹ Loading teal.code

q <- qenv() |> 
  eval_code(1 + 1, cache = TRUE) |> 
  eval_code(mtcars <- head(mtcars))

attr(q@code[[1]], "cache")
#> [1] 2
```

<sup>Created on 2025-06-03 with [reprex
v2.1.1](https://reprex.tidyverse.org)</sup>

---------

Co-authored-by: Dawid Kaledkowski <[email protected]>
Co-authored-by: Marcin <[email protected]>
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
averissimo added a commit to insightsengineering/teal.data that referenced this pull request Jun 12, 2025
…l_data` (#370)

# Pull Request

Fixes:

- insightsengineering/teal#1526

Built on top of:

- insightsengineering/teal.reporter#307
    - _(#307 will be closed once this PR is stable)_

### Companion PRs:

- insightsengineering/teal#1541
- insightsengineering/teal.code#255
- #370
- insightsengineering/teal.reporter#331
- insightsengineering/teal.modules.general#884

### Changes description

- [x] Cleanup of `teal_data` class to allow for `teal_report` extension
- [x] Change the `show()` method to remove reference to `teal_data`
specifically

---------

Co-authored-by: Dawid Kaledkowski <[email protected]>
Co-authored-by: Marcin <[email protected]>
averissimo and others added 2 commits June 17, 2025 14:42
# Pull Request

- Changes from `teal_reportable` branch at `{ŧeal.report}`
- Remove old logic that was defusing the argument
Copy link
Contributor Author

@averissimo averissimo left a comment

Choose a reason for hiding this comment

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

  • association plot is not storing the size of the plot
  • bivariate plot is not storing the size of the plot
  • There's an error in tm_outliers that only pops up sometimes with:

I cannot reproduce it consistently, my steps are:

  • Open App
  • Go to outliers module
  • Change width size to 200
  • Click on "Add to report"
Warning in .geometry(width, height, units, res) :
  NAs introduced by coercion
Warning: Error in .geometry: invalid width
  98: stop
  97: .geometry
  96: grDevices::png
  95: .toHTML.recordedplot [/home/averissimo/work/roche🟦/packages📦/teal.reporter/R/toHTML.R#62]
  93: toHTML.default [/home/averissimo/work/roche🟦/packages📦/teal.reporter/R/toHTML.R#8]
  91: .toHTML.chunk_output [/home/averissimo/work/roche🟦/packages📦/teal.reporter/R/toHTML.R#111]
  89: toHTML.default [/home/averissimo/work/roche🟦/packages📦/teal.reporter/R/toHTML.R#8]
  87: lapply
  86: reporter$append_cards [/home/averissimo/work/roche🟦/packages📦/teal.reporter/R/Reporter.R#63]
  85: observe [/home/averissimo/work/roche🟦/packages📦/teal.reporter/R/add_card.R#188]
  84: <observer:observeEvent(input$add_card_ok)> [/tmp/Rtmp0ZAG1Z/renv-package-new-41b3c7245b6ce/shiny/R/utils.R#1482]
   5: shiny::runApp [/tmp/Rtmp0ZAG1Z/renv-package-new-41b3c7245b6ce/shiny/R/runapp.R#388]
   4: eval [/home/averissimo/work/roche🟦/packages📦/teal.modules.general/dev-av/mega_app.R#44]
   3: eval
   1: source

I'm trying to tackle these

averissimo added a commit to insightsengineering/teal.reporter that referenced this pull request Sep 9, 2025
# Pull Request

<!--- Replace `#nnn` with your issue link for reference. -->

- Companion of
insightsengineering/teal.modules.general#884

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
@averissimo
Copy link
Contributor Author

averissimo commented Sep 9, 2025

Solved all bugs with the modules described above. (tm_outliers bug was caused by auto height not yet being calculated)

Last one before we merge (@m7pr I've re-tested all modules)

  • Download association module produces no plot (problem with teal.reporter::to_rmd()
    • Previewer is fine
image

@averissimo
Copy link
Contributor Author

I cannot approve my own PR, but the bug above is on teal.reporter.

This PR is fine by me, @m7pr please review and give your verdict :)

@m7pr
Copy link
Contributor

m7pr commented Sep 9, 2025

@averissimo already approved! I see the fix with grid.newpage in association plot
image

@averissimo averissimo merged commit 320e808 into main Sep 9, 2025
29 of 30 checks passed
@averissimo averissimo deleted the teal_reportable branch September 9, 2025 13:55
@github-actions github-actions bot locked and limited conversation to collaborators Sep 9, 2025
#' To learn more please refer to the vignette
#' `vignette("transform-module-output", package = "teal")` or the [`teal::teal_transform_module()`] documentation.
#'
#' @inheritSection teal::example_module Reporting
Copy link
Contributor

Choose a reason for hiding this comment

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

@averissimo I get a warning that this section does not exist. I was checking it's companion teal PR where I would have expected this section and it was not there. Am I missing something or do we need to updated the teal::example_module doc?

Copy link
Contributor

@gogonzo gogonzo Sep 18, 2025

Choose a reason for hiding this comment

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

I confirm. Section probably got removed here and teal.modules.* can't inherit reporter documentation. I think it is worth to have a # Reporting (and maybe @return) inherited from teal::example_module (or from other place in teal).

P.S. Name of the section could be more universal as SRC is also a concern

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was trying to track down where this cames from and finally found it in an open PR: https://github.com/insightsengineering/teal/pull/1545/files#diff-30b1b14a6fc7f2b6907f241d0f5d2e780dea7396ded16caffc8147b3d0fdf5a7

The @return tag will be tricky as these functions return the module itself. We could extend it to include what the srv returns

Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe something like this?

#' @return teal_module whose server returns reactive(<teal_data>) ...

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.

5 participants