From 04d278c66f084b88506cb387424e235be472bd98 Mon Sep 17 00:00:00 2001 From: "Matthew D. Smith" <47441066+mduncans@users.noreply.github.com> Date: Fri, 22 Aug 2025 16:07:39 -0400 Subject: [PATCH] =?UTF-8?q?Revert=20"duplicate=20conc=20values=20can=20occ?= =?UTF-8?q?ur=20via=20cmaxes,=20which=20causes=20error=20in=20pre=E2=80=A6?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- R/compute.R | 2 +- .../test-compute_exposure_predictions.R | 39 ------------------- 2 files changed, 1 insertion(+), 40 deletions(-) diff --git a/R/compute.R b/R/compute.R index 70074fe..241fe1c 100644 --- a/R/compute.R +++ b/R/compute.R @@ -1385,7 +1385,7 @@ compute_exposure_predictions <- function( if (!rlang::is_empty(cmaxes)) { new_conc <- c(prediction_df$conc, cmaxes) - prediction_df <- tibble::tibble(conc = sort(unique(new_conc))) + prediction_df <- tibble::tibble(conc = sort(new_conc)) } ########## SHOULD THIS BE ITS OWN FUNCTION? ############ diff --git a/tests/testthat/test-compute_exposure_predictions.R b/tests/testthat/test-compute_exposure_predictions.R index 04d86a9..a407742 100644 --- a/tests/testthat/test-compute_exposure_predictions.R +++ b/tests/testthat/test-compute_exposure_predictions.R @@ -32,42 +32,3 @@ test_that('compute_exposure_predictions runs fine for good model and full data', ) ) }) - - -test_that('compute_exposure_predictions does not add non-unique conc values with cmaxes', { - data_proc <- preprocess(cqtkit_data_dofetilide) - mod <- fit_prespecified_model( - data_proc, - deltaQTCF, - ID, - CONC, - deltaQTCFBL, - TRTG, - TAFD, - method = "ML", - remove_conc_iiv = TRUE - ) - - expo_pred <- compute_exposure_predictions( - data_proc, - mod, - CONC, - treatment_predictors = list( - CONC = 10, - deltaQTCFBL = 0, - TRTG = "Dofetilide", - TAFD = "1 HR" - ), - control_predictors = list( - CONC = 0, - deltaQTCFBL = 0, - TRTG = "Placebo", - TAFD = "1 HR" - ), - cmaxes = c(100, 200, 300) - ) - - expect_true( - expo_pred$conc |> length() == expo_pred$conc |> unique() |> length() - ) -})