Skip to content

Commit

Permalink
Merge pull request #69 from rpact-com/dev/4.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fpahlke authored Dec 17, 2024
2 parents ec247e4 + 0ffb567 commit da01d89
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
3 changes: 2 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
For more information, please visit: [rpact.org/iq](www.rpact.org/iq)
* Usage of `maxInformation` improved (see enhancement [#65](https://github.com/rpact-com/rpact/issues/65))
* `testPackage()`: additional warning details will be added to the test report if warnings exist
* Issue [#61](https://github.com/rpact-com/rpact/issues/61)) fixed
* Issue [#61](https://github.com/rpact-com/rpact/issues/61) fixed
* Issue [#68](https://github.com/rpact-com/rpact/issues/68) fixed
* Flexibility of function `getPiecewiseSurvivalTime()` improved
* Test coverage improved
* Minor improvements
Expand Down
5 changes: 1 addition & 4 deletions R/class_summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,7 @@ plot.SummaryFactory <- function(x, y, ..., showSummary = FALSE) {
}

.knitPrintQueue <- function(x, ..., sep = NA_character_, prefix = "") {
on.exit({
attr(x, "queue") <- NULL
})
on.exit(.resetPipeOperatorQueue(x))
result <- character()
if (inherits(x, "SummaryFactory")) {
queue <- attr(x$object, "queue")
Expand Down Expand Up @@ -234,7 +232,6 @@ print.SummaryFactory <- function(x, ...,
}
queue[[length(queue) + 1]] <- x$object
attr(x$object, "queue") <- queue

return(.knitPrintQueue(x, sep = sep))
}

Expand Down
12 changes: 11 additions & 1 deletion R/f_core_utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -1598,7 +1598,17 @@ getParameterName <- function(obj, parameterCaption) {
}

.resetPipeOperatorQueue <- function(x) {
attr(x, "queue") <- NULL
for (attrName in c("queue", "printObject", "printObjectSeparator")) {
tryCatch({
if (inherits(x, "SummaryFactory")) {
attr(x$object, attrName) <- NULL
} else {
attr(x, attrName) <- NULL
}
}, error = function(e) {
message("Failed to reset pipe operator queue attribute ", sQuote(attrName), ": ", e$message)
})
}
return(x)
}

Expand Down

0 comments on commit da01d89

Please sign in to comment.