Skip to content

duplicate conc values can occur via cmaxes, which causes error in pre…#5

Merged
mduncans merged 3 commits intomainfrom
predict_exposure_bug
Aug 22, 2025
Merged

duplicate conc values can occur via cmaxes, which causes error in pre…#5
mduncans merged 3 commits intomainfrom
predict_exposure_bug

Conversation

@mduncans
Copy link
Collaborator

…dict_with_exposure_plot. adding failing test showing conc column is not unique.

…dict_with_exposure_plot. adding failing test showing conc column is not unique.
@mduncans
Copy link
Collaborator Author

opening PR to run tests to confirm failing on CI.

@mduncans
Copy link
Collaborator Author

Initial failing mode calling predict_with_exposure_plot where cmaxes contained value already in compute_exposure_predictions:

> predict_with_exposure_plot(
+       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)
+     )
Error in `$<-.data.frame`:
! replacement has 2 rows, data has 1
Show Traceback

Now with unique call, correctly runs

> predict_with_exposure_plot(
+     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)
+ )
> 
image

@mduncans mduncans merged commit 7ebf2a3 into main Aug 22, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant