Skip to content

Commit

Permalink
bump required nmrec versions
Browse files Browse the repository at this point in the history
 - bump required `nmrec` versions in functions and tests relating to `intitial_estimates()` and `tweak_intitial_estimates()`
  • Loading branch information
barrettk committed Feb 7, 2024
1 parent 1aa5d88 commit eadc261
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
10 changes: 5 additions & 5 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ steps:
image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.0:latest
commands:
- R -s -e 'devtools::install_deps(upgrade = '"'"'never'"'"')'
# this can be removed once nmrec 0.3.0.8001 is available on MPN
- git clone --branch 0.3.0.8001 --depth 1 https://github.com/metrumresearchgroup/nmrec.git /tmp/nmrec
# this can be removed once nmrec 0.4.0 is available on MPN
- git clone --branch 0.4.0 --depth 1 https://github.com/metrumresearchgroup/nmrec.git /tmp/nmrec
- R -s -e 'devtools::install("/tmp/nmrec", upgrade = "never")'
- R -s -e 'devtools::check(env_vars = c("BBI_EXE_PATH" = "/ephemeral/bbi", "NOT_CRAN" = "true"))'
environment:
Expand All @@ -50,8 +50,8 @@ steps:
image: 906087756158.dkr.ecr.us-east-1.amazonaws.com/r-dev-ci-mpn-4.1:latest
commands:
- R -s -e 'devtools::install_deps(upgrade = '"'"'never'"'"')'
# this can be removed once nmrec 0.3.0.8001 is available on MPN
- git clone --branch 0.3.0.8001 --depth 1 https://github.com/metrumresearchgroup/nmrec.git /tmp/nmrec
# this can be removed once nmrec 0.4.0 is available on MPN
- git clone --branch 0.4.0 --depth 1 https://github.com/metrumresearchgroup/nmrec.git /tmp/nmrec
- R -s -e 'devtools::install("/tmp/nmrec", upgrade = "never")'
- R -s -e 'devtools::check(env_vars = c("BBI_EXE_PATH" = "/ephemeral/bbi", "NOT_CRAN" = "true"))'
environment:
Expand Down Expand Up @@ -107,7 +107,7 @@ steps:
commands:
- R -s -e 'devtools::install_deps(upgrade = '"'"'never'"'"')'
# nmrec isn't available until the 2023-09-19 snapshot.
- git clone --branch 0.3.0.8001 --depth 1 https://github.com/metrumresearchgroup/nmrec.git /tmp/nmrec
- git clone --branch 0.4.0 --depth 1 https://github.com/metrumresearchgroup/nmrec.git /tmp/nmrec
- R -s -e 'devtools::install("/tmp/nmrec", upgrade = "never")'
- R -s -e 'devtools::check(env_vars = c("BBI_EXE_PATH" = "/ephemeral/bbi", "NOT_CRAN" = "true"))'
environment:
Expand Down
2 changes: 1 addition & 1 deletion R/initial-estimates.R
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ initial_estimates <- function(.mod, flag_fixed = FALSE){
#' @noRd
get_initial_est <- function(.mod, flag_fixed = FALSE){

test_nmrec_version(.min_version = "0.3.0.8001")
test_nmrec_version(.min_version = "0.4.0")
check_model_object(.mod, "bbi_nonmem_model")


Expand Down
2 changes: 1 addition & 1 deletion R/tweak-initial-estimates.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ tweak_initial_estimates <- function(
){

# Assertions
test_nmrec_version(.min_version = "0.3.0.8001")
test_nmrec_version(.min_version = "0.4.0")
check_model_object(.mod, "bbi_nonmem_model")
checkmate::assert_true(all(tweak %in% BBR_ESTIMATES_INHERIT))

Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test-initial-estimates.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe("initial_estimates", {
})

it("get_theta_inits", {
skip_if_old_nmrec("0.3.0.8001")
skip_if_old_nmrec("0.4.0")
ctl <- nmrec::read_ctl(get_model_path(MOD1))
theta_inits <- get_theta_inits(ctl, mark_flags = "fix")

Expand All @@ -25,7 +25,7 @@ describe("initial_estimates", {
})

it("fmt_record_num", {
skip_if_old_nmrec("0.3.0.8001")
skip_if_old_nmrec("0.4.0")
ctl <- nmrec::read_ctl(get_model_path(MOD1))

# Test THETA
Expand Down Expand Up @@ -61,7 +61,7 @@ describe("initial_estimates", {
})

it("initial_estimates: integration", {
skip_if_old_nmrec("0.3.0.8001")
skip_if_old_nmrec("0.4.0")
mod_c <- read_model(file.path(MODEL_DIR_X, "1001"))
initial_est_df <- initial_estimates(mod_c, flag_fixed = TRUE)
initial_est <- get_initial_est(mod_c, flag_fixed = TRUE)
Expand All @@ -87,7 +87,7 @@ describe("initial_estimates", {
})

it("initial_estimates: SAME blocks", {
skip_if_old_nmrec("0.3.0.8001")
skip_if_old_nmrec("0.4.0")
mod_c <- read_model(file.path(MODEL_DIR_X, "acop-iov"))
initial_est_df <- initial_estimates(mod_c, flag_fixed = TRUE)
initial_est <- get_initial_est(mod_c, flag_fixed = TRUE)
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-tweak-initial-estimates.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# of the bounds.

describe("tweak_initial_estimates", {
skip_if_old_nmrec("0.3.0.8001")
skip_if_old_nmrec("0.4.0")

it("base case - tweaking initial value works", {
test_case <- list(
Expand Down

0 comments on commit eadc261

Please sign in to comment.