From 801e0443416e37de448b5e1a77c50305e21d40fa Mon Sep 17 00:00:00 2001 From: "Matthew L. Fidler" Date: Thu, 6 Jun 2024 21:49:01 -0500 Subject: [PATCH 1/4] Add cran coments --- cran-comments.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 cran-comments.md diff --git a/cran-comments.md b/cran-comments.md new file mode 100644 index 000000000..e571507d3 --- /dev/null +++ b/cran-comments.md @@ -0,0 +1,5 @@ +- This works with the new rxode2 parse +- This is more pendantic with the no-remap so that no-remap is everywhere :) +- This moves the ignored steady state indicators to a allocated + integer so garbage collection will not cause gcc-USBAN alignment + errors From b74c810e8a6e5b780750542cf9e4730ec0d57464 Mon Sep 17 00:00:00 2001 From: "Matthew L. Fidler" Date: Thu, 6 Jun 2024 21:49:58 -0500 Subject: [PATCH 2/4] Use dev version --- DESCRIPTION | 2 +- NEWS.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 7e638a95c..ddf646493 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: rxode2 -Version: 2.1.3 +Version: 2.1.3.9000 Title: Facilities for Simulating from ODE-Based Models Authors@R: c( person("Matthew L.","Fidler", diff --git a/NEWS.md b/NEWS.md index c8646c1e9..a725a4c8e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,5 @@ +# rxode2 (development version) + # rxode2 2.1.3 ## Bug fixes From 35b009e591134ac1159177834ab3754152e1081a Mon Sep 17 00:00:00 2001 From: "Matthew L. Fidler" Date: Thu, 6 Jun 2024 21:54:17 -0500 Subject: [PATCH 3/4] Add occ testing --- tests/testthat/test-occ.R | 65 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/tests/testthat/test-occ.R b/tests/testthat/test-occ.R index dd96823a2..2039cb0cc 100644 --- a/tests/testthat/test-occ.R +++ b/tests/testthat/test-occ.R @@ -289,4 +289,69 @@ rxTest({ .en <- rxExpandNesting(mod, .ni) }) + + test_that("nesting test from https://github.com/nlmixr2/rxode2random/issues/25", { + + mod <- rxode2({ + TABS = TV_TABS * exp(eta.TABS + iov.TABS) + TR_Fbio = TV_TR_Fbio + eta.TR_Fbio + iov.TR_Fbio + CL = TV_CL * exp(eta.CL) + V1 = TV_V1 * exp(eta.V1) + V2 = TV_V2 * exp(eta.V2) + CLD = TV_CLD * exp(eta.CLD) + KA = log(2) / (TABS/60) + FBIO = 1 / (exp(-TR_Fbio) + 1) + DC1 = AMT1/V1 + DC2 = AMT2/V2 + d/dt(AMTa) = -KA * AMTa + d/dt(AMT1) = FBIO * KA * AMTa - CLD * DC1 + CLD * DC2 - CL * DC1 + d/dt(AMT2) = + CLD * DC1 - CLD * DC2 + d/dt(AUC) = DC1 + }) + + n <- 10 + + theta <- c("TV_TABS" = 45, + "TV_TR_Fbio" = logit(x = 0.85), + "TV_CL" = 10, + "TV_V1" = 10, + "TV_V2" = 65, + "TV_CLD" = 25) + + + omega <- lotri::lotri( + lotri::lotri(eta.TABS~0.25, + eta.TR_Fbio~0.20, + eta.CL~0.30, + eta.V1~0.30, + eta.V2~0.45, + eta.CLD~0.15) | id(nu=n), + lotri::lotri(iov.TABS~0.15, + iov.TR_Fbio~0.15) | occ(nu=n*2)) + + dosing <- et(amt=1000, + addl=6, + ii=24, + evid=1, + cmt="AMTa", + time=0) %>% + et(amt=1000, + addl=6, + ii=24, + evid=4, + cmt="AMTa", + time = 336) %>% + et(seq(0,168,0.5)) %>% + et(seq(336,672,0.5)) %>% + et(id=seq(1,n)) + + dosing <- mutate(dosing, occ = 1) %>% + mutate(occ = ifelse(time>=336,2,occ)) + + expect_error(rxSolve(object = mod, + theta, + omega=omega, + ev=dosing, + nDisplayProgress=100L), NA) + }) }) From 4b8b7d872e84ec638cedc73b16593bbc77e3f0c8 Mon Sep 17 00:00:00 2001 From: "Matthew L. Fidler" Date: Thu, 6 Jun 2024 22:03:28 -0500 Subject: [PATCH 4/4] Call out dplyr package in testing --- tests/testthat/test-occ.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/testthat/test-occ.R b/tests/testthat/test-occ.R index 2039cb0cc..b0ed113b4 100644 --- a/tests/testthat/test-occ.R +++ b/tests/testthat/test-occ.R @@ -345,8 +345,8 @@ rxTest({ et(seq(336,672,0.5)) %>% et(id=seq(1,n)) - dosing <- mutate(dosing, occ = 1) %>% - mutate(occ = ifelse(time>=336,2,occ)) + dosing <- dplyr::mutate(dosing, occ = 1) %>% + dplyr::mutate(occ = ifelse(time>=336,2,occ)) expect_error(rxSolve(object = mod, theta,