Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dimension parameter in ospsuite::getBaseUnit #16

Merged
merged 2 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/output.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 <- ""
Expand Down
2 changes: 1 addition & 1 deletion R/parameter.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 <- ""
Expand Down
17 changes: 17 additions & 0 deletions tests/testthat/test-SAOutput.R
Original file line number Diff line number Diff line change
@@ -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)
})
16 changes: 16 additions & 0 deletions tests/testthat/test-SAParameter.R
Original file line number Diff line number Diff line change
@@ -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")
})
5 changes: 0 additions & 5 deletions tests/testthat/test-XXX.R

This file was deleted.

Loading