From b7ba27d5392fe37763c7d28a845eddd1cc01ba01 Mon Sep 17 00:00:00 2001 From: rengelke Date: Tue, 19 Nov 2024 20:27:19 +0100 Subject: [PATCH 1/2] remove incorrect parameter --- R/output.R | 2 +- R/parameter.R | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/R/output.R b/R/output.R index 138057d..55a7f1a 100644 --- a/R/output.R +++ b/R/output.R @@ -23,7 +23,7 @@ SAOutput <- R6::R6Class( self$dimension <- ospQuantity$dimension - self$unit <- unit %||% ospsuite::getBaseUnit(dimension = self$dimension) + self$unit <- unit %||% ospsuite::getBaseUnit(self$dimension) if (self$unit == "Unitless") { self$unit <- "" diff --git a/R/parameter.R b/R/parameter.R index 5476064..6235343 100644 --- a/R/parameter.R +++ b/R/parameter.R @@ -32,7 +32,7 @@ SAParameter <- R6::R6Class( self$dimension <- ospParameter$dimension - self$unit <- unit %||% ospsuite::getBaseUnit(dimension = self$dimension) + self$unit <- unit %||% ospsuite::getBaseUnit(self$dimension) if (self$unit == "Unitless") { self$unit <- "" From 3938332270fe44b60220d17d5b77bbc3f864dfed Mon Sep 17 00:00:00 2001 From: rengelke Date: Tue, 19 Nov 2024 20:28:36 +0100 Subject: [PATCH 2/2] add basic tests for SAParameter and SAOutput --- tests/testthat/test-SAOutput.R | 17 +++++++++++++++++ tests/testthat/test-SAParameter.R | 16 ++++++++++++++++ tests/testthat/test-XXX.R | 5 ----- 3 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 tests/testthat/test-SAOutput.R create mode 100644 tests/testthat/test-SAParameter.R delete mode 100644 tests/testthat/test-XXX.R diff --git a/tests/testthat/test-SAOutput.R b/tests/testthat/test-SAOutput.R new file mode 100644 index 0000000..522e233 --- /dev/null +++ b/tests/testthat/test-SAOutput.R @@ -0,0 +1,17 @@ +simPath <- system.file("extdata", "Aciclovir.pkml", package = "ospsuite") +simulation <- loadSimulation(simPath) +outputPath <- "Organism|PeripheralVenousBlood|Aciclovir|Plasma (Peripheral Venous Blood)" +parameterPath <- c("Aciclovir|Lipophilicity") + +test_that("SAOutput object can be created with default settings", { + expect_no_error( + SAOutputTest <- SAOutput$new( + simulation = simulation, + path = outputPath + ) + ) + expect_s3_class(SAOutputTest, "R6") + expect_equal(SAOutputTest$path, outputPath) + expect_equal(SAOutputTest$displayName, outputPath) + expect_null(SAOutputTest$pkParameterList) +}) diff --git a/tests/testthat/test-SAParameter.R b/tests/testthat/test-SAParameter.R new file mode 100644 index 0000000..6814931 --- /dev/null +++ b/tests/testthat/test-SAParameter.R @@ -0,0 +1,16 @@ +simPath <- system.file("extdata", "Aciclovir.pkml", package = "ospsuite") +simulation <- loadSimulation(simPath) +parameterPath <- c("Aciclovir|Lipophilicity") + +test_that("SAParameter object can be created with default settings", { + expect_no_error( + SAParameterTest <- SAParameter$new( + simulation = simulation, + path = parameterPath + ) + ) + expect_s3_class(SAParameterTest, "R6") + expect_equal(SAParameterTest$path, parameterPath) + expect_equal(SAParameterTest$displayName, parameterPath) + expect_equal(SAParameterTest$unit, "Log Units") +}) diff --git a/tests/testthat/test-XXX.R b/tests/testthat/test-XXX.R deleted file mode 100644 index 8a2b4ae..0000000 --- a/tests/testthat/test-XXX.R +++ /dev/null @@ -1,5 +0,0 @@ -context("XXXXXXXXXXXXX") - -test_that("Money makes the world go round", { - # ... -})