Skip to content

Commit

Permalink
Merge pull request #175 from nlmixr2/174-omegap-should-be-ignored-at-…
Browse files Browse the repository at this point in the history
…this-point

ignore omegap records
  • Loading branch information
mattfidler authored May 25, 2024
2 parents 7c1e351 + 873e447 commit 857f352
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 3
cache-version: 4
pak-version: devel
extra-packages: |
any::rcmdcheck
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- uses: r-lib/actions/setup-r-dependencies@v2
with:
cache-version: 2
cache-version: 3
pak-version: devel
extra-packages: |
any::covr
Expand Down
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# nonmem2rx (development version)

* Omega and Sigma prior estimates are currently ignored

* Read all NONMEM files using latin1 encoding to allow single byte
parser to work

Expand Down
18 changes: 13 additions & 5 deletions R/records.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@
sub="sub", # $subroutines
abb="abb", # $abbrevited
pre="pre", # $pred
the="the", # $theta
the="the", # $heta
thetap="thetap", #thetap
thetapv="thetapv", # thetapv
ome="ome", # $omega
omegap="omegap", #omegap
omegapd="omegapd", # omegapd
sig="sig", # $sigma
sigmap="sigmap", #sigmap
sigmapd="sigmapd", # sigmapd
msf="msf", # $msfi
sim="sim", # $simulation
est="est", # $estimation
Expand Down Expand Up @@ -47,11 +51,15 @@
sub="$SUBROUTINES", # $subroutines
abb="$ABBREVITED", # $abbrevited
pre="$PRED", # $pred
the="$THETA", # $theta
the="$gTHETA", # $theta
thetap="$THETAP", # $thetap
thetapv="$THETAPV", # $thetapv
ome="$OMEGA", # $omega
omegap="$OMEGAP", # $omegap
omegapd="$OMEGAPD", # $omegapd
sig="$SIGMA", # $sigma
sigmap="$SIGMAP", # $sigmap
sigmapd="$SIGMAPD", # $sigmapd
msf="$MSFI", # $msfi
mix="$MIX",
sim="$SIMULATION", # $simulation
Expand Down Expand Up @@ -87,9 +95,9 @@
.rec <- tolower(rec)
.ret <- .transRecords[.rec]
if (is.na(.ret)) {
if (.rec == "thetap") {
.ret <- .transRecords[.rec]
} else if (.rec == "thetapv") {
if (.rec %in% c("thetap", "thetapv",
"omegap", "omegapd",
"sigmap", "sigmapd")) {
.ret <- .transRecords[.rec]
} else {
.rec0 <- substr(.rec, 1, 3)
Expand Down
8 changes: 8 additions & 0 deletions tests/testthat/test-bauer-2019.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,13 @@ if (identical(Sys.getenv("NOT_CRAN"), "true")) {
})
})

withr::with_options(list(nonmem2rx.save=FALSE, nonmem2rx.load=FALSE, nonmem2rx.overwrite=FALSE,
nonmem2rx.extended=FALSE), {
rx <- nonmem2rx(system.file("mods/bauer_2019_cptpsp_tutorial_2/supp2/504_nuts.ctl",
package="nonmem2rx"))

expect_true(dim(rx$omega)[1] == 2)
})


}

0 comments on commit 857f352

Please sign in to comment.