Skip to content

Commit

Permalink
tar_nlmixr_multimodel() works with origData reassignment
Browse files Browse the repository at this point in the history
  • Loading branch information
billdenney committed Mar 17, 2024
1 parent a59fcd9 commit 624e583
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions R/tar_nlmixr_multimodel.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ tar_nlmixr_multimodel_single <- function(object, name, data, est, control, table
table = table,
object_simple_name = paste0(name_hash, "_osimple"),
data_simple_name = paste0(name_hash, "_dsimple"),
fit_simple_name = paste0(name_hash, "_fitsimple"),
env = env
)
list(
Expand Down
8 changes: 4 additions & 4 deletions tests/testthat/test-tar_nlmixr_multimodel.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ test_that("tar_nlmixr_multimodel", {
# One for each model and then one for combining everything
expect_length(target_list, 3)
# Data and object simplification, then the fitting
expect_length(target_list[[1]], 3)
expect_length(target_list[[1]], 4)
# Data and object simplification, then the fitting
expect_length(target_list[[2]], 3)
expect_length(target_list[[2]], 4)
# Combine the fit models as a single step
expect_s3_class(target_list[[3]], "tar_stem")
expect_equal(target_list[[3]]$settings$name, "foo")
Expand All @@ -59,8 +59,8 @@ test_that("tar_nlmixr_multimodel", {
expect_equal(names(collating_call), c("", "my first model", "my second model"))

# Verify the targets created are the ones being collated
expect_equal(collating_call[[2]], as.name(target_list[[1]][[3]]$settings$name))
expect_equal(collating_call[[3]], as.name(target_list[[2]][[3]]$settings$name))
expect_equal(collating_call[[2]], as.name(target_list[[1]][[4]]$settings$name))
expect_equal(collating_call[[3]], as.name(target_list[[2]][[4]]$settings$name))
})

test_that("tar_nlmixr_multimodel works with long model names", {
Expand Down

0 comments on commit 624e583

Please sign in to comment.