Skip to content

Commit

Permalink
Styler
Browse files Browse the repository at this point in the history
  • Loading branch information
PavelBal committed May 19, 2021
1 parent 810f2d8 commit d0548e3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions R/error-checks.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ validateIsSameLength <- function(...) {
stop(messages$errorDifferentLength(arguments))
}

validatePathIsAbsolute <- function(path){
validatePathIsAbsolute <- function(path) {
wildcardChar <- "*"
if (any(unlist(strsplit(path, ""), use.names = FALSE) == wildcardChar)){
if (any(unlist(strsplit(path, ""), use.names = FALSE) == wildcardChar)) {
stop(messages$errorEntityPathNotAbsolute(path))
}
}
8 changes: 5 additions & 3 deletions R/messages.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@ messages <- list(
errorPKParameterNotFound = function(pkParameterName, allPKParameterNames) {
paste0("PK-Parameter '", pkParameterName, "' not found.\nAvailable PK-Parameters are:\n", paste0(allPKParameterNames, collapse = ", "))
},
errorEntityPathNotAbsolute = function(path){
paste0("Only absolut paths (i.e. without the wildcard(s) `*`) are allowed, but the passed path is: ",
path)
errorEntityPathNotAbsolute = function(path) {
paste0(
"Only absolut paths (i.e. without the wildcard(s) `*`) are allowed, but the passed path is: ",
path
)
},
pkSimRPathInvalid = function(pksimPath) {
paste0("Path to PKSim.R.dll '", pksimPath, "' is invalid.")
Expand Down
6 changes: 4 additions & 2 deletions R/utilities-parameter.R
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@ setParameterValues <- function(parameters, values) {
#' setParameterValuesByPath(c("Organism|Liver|Volume", "Organism|Volume"), c(2, 3), sim)
#' @export
setParameterValuesByPath <- function(parameterPaths, values, simulation) {
setQuantityValuesByPath(quantityPaths = parameterPaths, values = values,
simulation = simulation)
setQuantityValuesByPath(
quantityPaths = parameterPaths, values = values,
simulation = simulation
)
}

#' Scale current values of parameters using a factor
Expand Down
8 changes: 5 additions & 3 deletions R/utilities-quantity.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,11 @@ setQuantityValuesByPath <- function(quantityPaths, values, simulation) {
validateIsOfType(simulation, Simulation)

task <- getContainerTask()
for (i in seq_along(quantityPaths)){
rClr::clrCall(task, "SetValueByPath", simulation$ref,
enc2utf8(quantityPaths[[i]]), values[[i]])
for (i in seq_along(quantityPaths)) {
rClr::clrCall(
task, "SetValueByPath", simulation$ref,
enc2utf8(quantityPaths[[i]]), values[[i]]
)
}
}

Expand Down

0 comments on commit d0548e3

Please sign in to comment.