-
-
Notifications
You must be signed in to change notification settings - Fork 10
{teal}
module returns a teal_report
object that extends from teal_data
#331
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
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Marcin <[email protected]>
Signed-off-by: Marcin <[email protected]>
Signed-off-by: Marcin <[email protected]>
Code Coverage Summary
Diff against main
Results for commit: 6d38378 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Unit Tests Summary 1 files 20 suites 38s ⏱️ Results for commit b791939. |
Unit Tests Summary 1 files 20 suites 37s ⏱️ Results for commit b7c4623. ♻️ This comment has been updated with latest results. |
Unit Test Performance Difference
Additional test case details
Results for commit f2b6b10 ♻️ This comment has been updated with latest results. |
Changed names - `teal_reporter@report` -> `teal_reporter@teal_card` - `teal.reporter::doc()` -> `teal.reporter::teal_card()` - `teal.reporter::report()` -> `teal.reporter::teal_card()` So now you can use ```r data <- teal.reporter::teal_report() # teal_report() class data@teal_card # teal_card class teal.reporter::teal_card(data) # teal_card class ``` Also `teal_card` is the creator, the getter and the setter ```r data <- teal.reporter::teal_report() teal_card(data) <- teal_card() # setter + creator teal_card(data) # getter data@teal_card # direct slot access ``` Companion to: - insightsengineering/teal#1542 - insightsengineering/teal.modules.general#885 - insightsengineering/teal.code#256 --------- Signed-off-by: Marcin <[email protected]> Signed-off-by: André Veríssimo <[email protected]> Co-authored-by: André Veríssimo <[email protected]>
#' @examples | ||
#' # Create a new empty card | ||
#' report <- teal_card() | ||
#' class(report) # Check the class of the object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Class names are rather internal names. Let's remove it from user-facing docs
#' class(report) # Check the class of the object |
#' It enables users to create, manipulate, and serialize report-related data efficiently. | ||
#' | ||
#' The `teal_card()` function serves two purposes: | ||
#' 1. When called with a `teal_report` object, it acts as a getter and returns the card slot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not only with a teal_report
object but that object must be a first argument
#' The `teal_card()` function serves two purposes: | ||
#' 1. When called with a `teal_report` object, it acts as a getter and returns the card slot | ||
#' 2. When called with other arguments, it creates a new `teal_card` object from those arguments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this adds ambiguity. can we keep it as a constructor only?
# Manual import instead of using backports and adding 1 more dependency | ||
if (getRversion() < "4.4") { | ||
`%||%` <- function(x, y) if (is.null(x)) y else x | ||
assign("`%||%`", `%||%`, envir = getNamespace(pkgname)) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we already import rlang
- let's take it from there instead of rewriting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- what's our strategy for
eval_code
? I thought we are discouraging the usage of this and here I can see the opposite - (related to above) do we plan to have the same for
within
?
#' These objects are typically processed later to generate the final R Markdown text. | ||
#' | ||
#' @param code A character string containing the R code. | ||
#' @param ... Additional named parameters to be included as chunk options (e.g., `echo = TRUE`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- please expand on the documentation that these parameters are further used in the markdown code chunks - is it this? https://yihui.org/knitr/options/
- add assert that the list must be named
Pull Request
Fixes:
Built on top of:
teal.reporter
Cards #307teal.reporter
Cards #307 will be closed once this PR is stable)Companion PRs:
{teal}
module returns ateal_report
object that extends fromteal_data
teal#1541{teal}
module returns ateal_report
object that extends fromteal_data
teal.code#255{teal}
module returns ateal_report
object that extends fromteal_data
teal.data#370{teal}
module returns ateal_report
object that extends fromteal_data
#331{teal}
module returns ateal_report
object that extends fromteal_data
teal.modules.general#884Changes description
teal_report
that extendsteal_data
eval_code()
andeval_code(cache = TRUE)
report(<teal_report>)
report_document
todoc
/document
/page
(final name TBD)