From 394c45f02b9d6282b0d9cfba0722bee05d45c2a7 Mon Sep 17 00:00:00 2001 From: "Matthew L. Fidler" Date: Thu, 7 Mar 2024 14:50:14 -0600 Subject: [PATCH 1/5] Add fix for #661 (tested in nlmixr2est) --- R/rxsolve.R | 1 + 1 file changed, 1 insertion(+) diff --git a/R/rxsolve.R b/R/rxsolve.R index f6aacc4a1..804f9bd40 100644 --- a/R/rxsolve.R +++ b/R/rxsolve.R @@ -1149,6 +1149,7 @@ rxSolve.function <- function(object, params = NULL, events = NULL, inits = NULL, .uiRxControl <- function(ui, params = NULL, events = NULL, inits = NULL, ..., theta = NULL, eta = NULL) { .ctl <- rxControl() + ui <- rxUiDecompress(ui) if (exists("meta", envir=ui)) { .meta <- get("meta", ui) } else { From 5c2873b5b9a63c4329b7117b78ec6499faf5bd6a Mon Sep 17 00:00:00 2001 From: "Matthew L. Fidler" Date: Thu, 7 Mar 2024 15:04:50 -0600 Subject: [PATCH 2/5] Fix includes an assertion that the ui is actually a rxode2 ui object --- R/rxsolve.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/rxsolve.R b/R/rxsolve.R index 804f9bd40..976842c63 100644 --- a/R/rxsolve.R +++ b/R/rxsolve.R @@ -1149,7 +1149,7 @@ rxSolve.function <- function(object, params = NULL, events = NULL, inits = NULL, .uiRxControl <- function(ui, params = NULL, events = NULL, inits = NULL, ..., theta = NULL, eta = NULL) { .ctl <- rxControl() - ui <- rxUiDecompress(ui) + ui <- rxUiDecompress(assertRxUi(uii)) if (exists("meta", envir=ui)) { .meta <- get("meta", ui) } else { From 08e279f2aa913a68741003cf33d993901eb5a1cd Mon Sep 17 00:00:00 2001 From: "Matthew L. Fidler" Date: Thu, 7 Mar 2024 15:05:57 -0600 Subject: [PATCH 3/5] Increment version number to 2.1.2.9000 --- DESCRIPTION | 2 +- NEWS.md | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 48be1d077..b5a65a340 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: rxode2 -Version: 2.1.2 +Version: 2.1.2.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 4bbf88ad3..7adf81596 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,5 @@ +# rxode2 (development version) + # rxode2 2.1.2 ## Other changes From aac3365e7e9bf64c06bd7c345336adcc3ce99242 Mon Sep 17 00:00:00 2001 From: "Matthew L. Fidler" Date: Thu, 7 Mar 2024 15:07:44 -0600 Subject: [PATCH 4/5] add to news --- NEWS.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/NEWS.md b/NEWS.md index 7adf81596..0bdc6a5b3 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # rxode2 (development version) +## Bug fixes + +- Make sure that the object is a uncompressed rxode2 ui for solving with `rxSolve` (See #661) + # rxode2 2.1.2 ## Other changes From f2b0a8e742167734a8d7c206b290f0d91c015cd0 Mon Sep 17 00:00:00 2001 From: "Matthew L. Fidler" Date: Wed, 13 Mar 2024 11:45:34 -0500 Subject: [PATCH 5/5] More robust handling of $meta --- R/rxsolve.R | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/R/rxsolve.R b/R/rxsolve.R index 976842c63..92c553e6a 100644 --- a/R/rxsolve.R +++ b/R/rxsolve.R @@ -1149,10 +1149,8 @@ rxSolve.function <- function(object, params = NULL, events = NULL, inits = NULL, .uiRxControl <- function(ui, params = NULL, events = NULL, inits = NULL, ..., theta = NULL, eta = NULL) { .ctl <- rxControl() - ui <- rxUiDecompress(assertRxUi(uii)) - if (exists("meta", envir=ui)) { - .meta <- get("meta", ui) - } else { + .meta <- try(ui$meta, silent=TRUE) + if (!is.environment(.meta)) { .meta <- new.env(parent=emptyenv()) } .lst <- list(...)