-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #229 from pascal-sauer/master
fix prepExtendedComment called from package::fun
- Loading branch information
Showing
16 changed files
with
104 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
Type: Package | ||
Package: madrat | ||
Title: May All Data be Reproducible and Transparent (MADRaT) * | ||
Version: 3.15.2 | ||
Date: 2024-11-06 | ||
Version: 3.15.3 | ||
Date: 2024-11-12 | ||
Authors@R: c( | ||
person("Jan Philipp", "Dietrich", , "[email protected]", role = c("aut", "cre"), | ||
comment = c(affiliation = "Potsdam Institute for Climate Impact Research", ORCID = "0000-0002-4309-6431")), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#' functionCallString | ||
#' | ||
#' Create a string representation for a function call. If the resulting string | ||
#' is longer than getConfig("maxLengthLogMessage") arguments are printed as | ||
#' passed (e.g. as variable name instead of the evaluated content of that | ||
#' variable), if that is still too long it is cropped. | ||
#' | ||
#' @param functionName name of the called function | ||
#' @param argumentValues the list of arguments passed | ||
#' @return A string representing the given function call | ||
#' | ||
#' @author Pascal Sauer | ||
functionCallString <- function(functionName, argumentValues) { | ||
nonDefaultArguments <- getNonDefaultArguments(functionName, argumentValues) | ||
argsString <- paste0(list(nonDefaultArguments)) # wrap everything in list for nicer string output | ||
argsString <- substr(argsString, 6, nchar(argsString) - 1) # remove superfluous list from string | ||
|
||
callWithEvaluatedArgs <- paste0(functionName, "(", argsString, ")") | ||
if (nchar(callWithEvaluatedArgs) <= getConfig("maxLengthLogMessage")) { | ||
functionCallString <- callWithEvaluatedArgs | ||
} else { | ||
functionCallString <- paste0(deparse(sys.call(-1)), collapse = "") | ||
if (nchar(functionCallString) > getConfig("maxLengthLogMessage")) { | ||
functionCallString <- paste0(substr(callWithEvaluatedArgs, 1, | ||
getConfig("maxLengthLogMessage") - 3), "...") | ||
} | ||
} | ||
return(functionCallString) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.