Skip to content

Commit

Permalink
SensitivityAnalysis - use "by path" methods (#271)
Browse files Browse the repository at this point in the history
* Use unlist

* Assign condition to a variable

* Skipping tests that rely on PK-Sim

* fix `createEsqlabsPlotConfiguration()`

Co-authored-by: Indrajeet Patil <patilindrajeet.science@gmail.com>
  • Loading branch information
PavelBal and IndrajeetPatil authored Jul 19, 2022
1 parent 374a7d7 commit b64598c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 8 deletions.
19 changes: 12 additions & 7 deletions R/sensitivityCalculation.R
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,21 @@ sensitivityCalculation <- function(simulation,
# Initialize `batchResultsIdMap` for the current parameter
batchResultsIdMap[[parameterPath]] <- vector("list", length(variationRange))
names(batchResultsIdMap[[parameterPath]]) <- variationRange

param <- getParameter(parameterPath, simulation)

if (param$isConstant) {
constantParamPaths <- c(constantParamPaths, parameterPath)
} else {
# Check if the parameter is given by an explicit formula
isExplicitFormulaByPath <- ospsuite::isExplicitFormulaByPath(
path = parameterPath,
simulation = simulation
)
if (isExplicitFormulaByPath) {
formulaParamPaths <- c(formulaParamPaths, parameterPath)
} else {
constantParamPaths <- c(constantParamPaths, parameterPath)
}

initialValues[[parameterPath]] <- param$value
initialValues[[parameterPath]] <- ospsuite::getQuantityValuesByPath(
quantityPaths = parameterPath,
simulation = simulation
)
}

constantParamPaths <- unlist(constantParamPaths)
Expand Down
2 changes: 1 addition & 1 deletion R/utilities-figures.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ createEsqlabsPlotConfiguration <- function() {
defaultPlotConfiguration$yLabelSize <- 8
defaultPlotConfiguration$xAxisLabelTicksSize <- 8
defaultPlotConfiguration$yAxisLabelTicksSize <- 8
defaultPlotConfiguration$legendCaptionSize <- 6
defaultPlotConfiguration$legendTitleSize <- 6
defaultPlotConfiguration$legendPosition <- tlf::LegendPositions$outsideTop

return(defaultPlotConfiguration)
Expand Down
2 changes: 2 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ environment:
R_ARCH: x64
KEEP_VIGNETTES: true
NOT_CRAN: true
#We use this variale to skip some tests that depend on PK-Sim using "skip_on_ci"
CI: true

version: "$(app_version).{build}"

Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-utilities-individual.R
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## context("readIndividualCharacteristicsFromXLS")
skip_on_ci()

test_that("It returns NULL if the specified individual Id cannot be found in
the file and nullIfNotFound is TRUE", {
Expand Down

0 comments on commit b64598c

Please sign in to comment.