diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml index 31a002c..3ed1ead 100644 --- a/.github/workflows/R-CMD-check.yaml +++ b/.github/workflows/R-CMD-check.yaml @@ -53,7 +53,11 @@ jobs: pak-version: devel extra-packages: | any::rcmdcheck + nlmixr2/dparser-R + nlmixr2/lbfgsb3c nlmixr2/lotri + nlmixr2/PreciseSums + nlmixr2/n1qn1c nlmixr2/rxode2ll nlmixr2/rxode2 nlmixr2/nlmixr2est diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml index 8cc9ff7..c4d2652 100644 --- a/.github/workflows/pkgdown.yaml +++ b/.github/workflows/pkgdown.yaml @@ -34,7 +34,11 @@ jobs: pak-version: devel extra-packages: | any::pkgdown + nlmixr2/dparser-R + nlmixr2/lbfgsb3c nlmixr2/lotri + nlmixr2/PreciseSums + nlmixr2/n1qn1c nlmixr2/rxode2ll nlmixr2/rxode2 nlmixr2/nlmixr2est diff --git a/.github/workflows/test-coverage.yaml b/.github/workflows/test-coverage.yaml index 94d5963..b4733fd 100644 --- a/.github/workflows/test-coverage.yaml +++ b/.github/workflows/test-coverage.yaml @@ -27,7 +27,11 @@ jobs: pak-version: devel extra-packages: | any::covr + nlmixr2/dparser-R + nlmixr2/lbfgsb3c nlmixr2/lotri + nlmixr2/PreciseSums + nlmixr2/n1qn1c nlmixr2/rxode2ll nlmixr2/rxode2 nlmixr2/nlmixr2est diff --git a/R/modeldb.R b/R/modeldb.R index 2138e68..620d75e 100644 --- a/R/modeldb.R +++ b/R/modeldb.R @@ -123,16 +123,18 @@ addFileToModelDb <- function(dir, file, modeldb) { dosing <- NULL dosing_meta <- mod$meta$dosing if(!is.null(dosing_meta)){ - dosing = paste(dosing_meta, collapse=",") + dosing <- paste(dosing_meta, collapse=",") }else { - if("depot" %in% mod$params$cmt){ - dosing = c(dosing, "depot") } - if("central" %in% mod$params$cmt){ - dosing = c(dosing, "central") } - if(!is.null(dosing)){ - dosing = paste(dosing, collapse=",") + if("depot" %in% mod$props$cmt) { + dosing <- c(dosing, "depot") + } + if("central" %in% mod$props$cmt) { + dosing <- c(dosing, "central") + } + if(!is.null(dosing)) { + dosing <- paste(dosing, collapse=",") } else { - dosing = NA_character_ + dosing <- NA_character_ } } @@ -143,7 +145,7 @@ addFileToModelDb <- function(dir, file, modeldb) { depends = paste(depends_meta, collapse=",") } if(is.null(depends)){ - depends = NA_character_ + depends = NA_character_ } # Extract the parameter names @@ -166,14 +168,14 @@ addFileToModelDb <- function(dir, file, modeldb) { if (is.null(paramErr)) { paramErr <- "" } - - - if(!mod$params$linCmt && (length(mod$params$cmt) == 0)){ + + + if(!mod$props$linCmt && (length(mod$props$cmt) == 0)){ algebraic = TRUE } else { algebraic = FALSE } - + ret <- data.frame( @@ -181,7 +183,7 @@ addFileToModelDb <- function(dir, file, modeldb) { description = description, parameters = paste(modParamFixed, collapse = ","), DV = paramErr, - linCmt = mod$params$linCmt, + linCmt = mod$props$linCmt, algebraic = algebraic, dosing = dosing, depends = depends, diff --git a/R/transPk.R b/R/transPk.R index d2dac9d..902bb4e 100644 --- a/R/transPk.R +++ b/R/transPk.R @@ -160,6 +160,7 @@ addLogEstimates <- function(ui, vars, .tmp$pre, .extra, extraLines, + .tmp$w, .tmp$post ) } diff --git a/tests/testthat/test-transPk.R b/tests/testthat/test-transPk.R index c722e38..b13571d 100644 --- a/tests/testthat/test-transPk.R +++ b/tests/testthat/test-transPk.R @@ -4,6 +4,10 @@ test_that("transPk -- k", { pkTrans("k") expect_true(all(c("lkel", "lk12", "lk21", "lk13", "lk31") %in% names(p3k$theta))) + # Issue #87 -- Make sure depot is not dropped + expect_equal(rxode2::modelExtract(p3k, "d/dt(depot)"), + "d/dt(depot) <- -ka * depot") + p2k <- readModelDb("PK_2cmt_des") |> pkTrans("k") expect_true(all(c("lkel", "lk12", "lk21") %in% names(p2k$theta)))