Skip to content

Fixes #1086 remove group_by to optimize computation and suggest parallel #1130

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

Merged
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
3 changes: 2 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ Suggests:
styler,
rClr,
crayon,
webshot
webshot,
parallel
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.2.3
Expand Down
330 changes: 229 additions & 101 deletions R/utilities-ratio-comparison.R

Large diffs are not rendered by default.

18 changes: 18 additions & 0 deletions man/getMonteCarloMedians.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 22 additions & 0 deletions man/getPKRatioSummaryFromSettings.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions man/getPKRatioSummaryStatistics.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions man/summaryStatisticsToDataFrame.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions tests/testthat/test-monte-carlo-sampling.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ comparisonParams <- list(meanlog = 1, sdlog = 2)
set.seed(1111)

referenceData <- data.frame(
simulationSetName = "reference",
IndividualId = 1:popSize,
QuantityPath = "a",
Parameter = "Cmax",
Expand All @@ -21,7 +20,6 @@ referenceData <- data.frame(
)

comparisonData <- data.frame(
simulationSetName = "test",
IndividualId = 1:popSize,
QuantityPath = "a",
Parameter = "Cmax",
Expand Down Expand Up @@ -63,7 +61,7 @@ test_that("Monte Carlo Solution is close to known solution", {
referencePKData = referenceData,
simulationSetName = "test",
# With 10000 repetitions the method runs longer
settings = list(showProgress = FALSE, mcRepetitions = 200)
settings = list(showProgress = FALSE, numberOfCores = 1, mcRepetitions = 200)
)

expect_equal(
Expand All @@ -84,13 +82,13 @@ test_that("Monte Carlo Solution is repeatable", {
pkData = comparisonData,
referencePKData = referenceData,
simulationSetName = "test",
settings = list(showProgress = FALSE, mcRepetitions = 100, mcRandomSeed = 3333)
settings = list(showProgress = FALSE, numberOfCores = 1, mcRepetitions = 100, mcRandomSeed = 3333)
)
mcSolution2 <- ospsuite.reportingengine:::getPKRatioSummaryFromMCSampling(
pkData = comparisonData,
referencePKData = referenceData,
simulationSetName = "test",
settings = list(showProgress = FALSE, mcRepetitions = 100, mcRandomSeed = 3333)
settings = list(showProgress = FALSE, numberOfCores = 1, mcRepetitions = 100, mcRandomSeed = 3333)
)

expect_equal(mcSolution1, mcSolution2)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-pop-pk-parameters.R
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,4 @@ updatePKParameter("AUC_tEnd", displayName = "AUC_tEnd", displayUnit = "µmol*min
# Clear test workflow folders
unlink(workflowPediatric$workflowFolder, recursive = TRUE)
unlink(workflowParallel$workflowFolder, recursive = TRUE)
#unlink(workflowRatio$workflowFolder, recursive = TRUE)
unlink(workflowRatio$workflowFolder, recursive = TRUE)