Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/philipdelff/NMdata
Browse files Browse the repository at this point in the history
  • Loading branch information
philipdelff committed Aug 18, 2024
2 parents 23f743e + 55ce2d8 commit 2430d1d
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 58 deletions.
Binary file modified tests/testthat/testReference/NMdataConf_01.rds
Binary file not shown.
Binary file modified tests/testthat/testReference/NMdataConf_02.rds
Binary file not shown.
Binary file modified tests/testthat/testReference/NMreadExt_01.rds
Binary file not shown.
Binary file modified tests/testthat/testReference/NMreadExt_02.rds
Binary file not shown.
Binary file modified tests/testthat/testReference/NMreadExt_03.rds
Binary file not shown.
Binary file modified tests/testthat/testReference/NMreadExt_04.rds
Binary file not shown.
Binary file modified tests/testthat/testReference/NMreadExt_05.rds
Binary file not shown.
Binary file removed tests/testthat/testReference/NMrelate_02.rds
Binary file not shown.
59 changes: 4 additions & 55 deletions tests/testthat/test_NMdataConf.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ context("NMdataConf")

NMdataConf(reset=TRUE)

## can't compare functions
dropFuns <- function(x){
x$as.fun <- NULL
x$file.mod <- NULL
Expand All @@ -24,7 +25,7 @@ test_that("defaults",{
expect_equal_to_reference(defaults,fileRef)

## compareCols(readRDS(fileRef),defaults)

})

test_that("reset",{
Expand All @@ -36,20 +37,6 @@ test_that("reset",{

defaults <- dropFuns(defaults)
defaults2 <- dropFuns(defaults2)
## defaults$as.fun <- NULL
## defaults$file.mod <- NULL
## defaults$file.cov <- NULL
## defaults$file.ext <- NULL
## defaults$file.phi <- NULL
## defaults$file.shk <- NULL
## defaults$modelname <- NULL
## defaults2$as.fun <- NULL
## defaults2$file.mod <- NULL
## defaults2$file.cov <- NULL
## defaults2$file.ext <- NULL
## defaults2$file.phi <- NULL
## defaults2$file.shk <- NULL
## defaults2$modelname <- NULL


expect_equal(defaults,defaults2)
Expand Down Expand Up @@ -96,21 +83,6 @@ test_that("change fun in globalenv does not affect NMdataConf()",{
defaults <- dropFuns(defaults)
defaults2 <- dropFuns(defaults2)

## defaults$as.fun <- NULL
## defaults$file.mod <- NULL
## defaults$file.cov <- NULL
## defaults$file.ext <- NULL
## defaults$file.phi <- NULL
## defaults$file.shk <- NULL
## defaults$modelname <- NULL
## defaults2$as.fun <- NULL
## defaults2$file.mod <- NULL
## defaults2$file.cov <- NULL
## defaults2$file.ext <- NULL
## defaults2$file.phi <- NULL
## defaults2$file.shk <- NULL
## defaults2$modelname <- NULL

expect_equal(defaults,defaults2)
})

Expand Down Expand Up @@ -143,22 +115,6 @@ test_that("change fun in globalenv does not affect NMdataConf()",{
defaults <- dropFuns(defaults)
defaults2 <- dropFuns(defaults2)

## defaults$as.fun <- NULL
## defaults$file.mod <- NULL
## defaults$file.cov <- NULL
## defaults$file.ext <- NULL
## defaults$file.phi <- NULL
## defaults$file.shk <- NULL
## defaults$modelname <- NULL

## defaults2$as.fun <- NULL
## defaults2$file.mod <- NULL
## defaults2$file.cov <- NULL
## defaults2$file.ext <- NULL
## defaults2$file.phi <- NULL
## defaults2$file.shk <- NULL
## defaults2$modelname <- NULL

expect_equal(defaults,defaults2)
})

Expand All @@ -173,17 +129,10 @@ test_that("deprecated use.rds",{
NMdataConf(formats.read=c("csv"))
new <- NMdataConf()

## can't compare functions
new$as.fun <- NULL
new$file.cov <- NULL
new$file.ext <- NULL
new$file.mod <- NULL
new$file.phi <- NULL
new$file.shk <- NULL
new$modelname <- NULL
new <- dropFuns(new)

expect_equal_to_reference(new,fileRef)
compareCols(readRDS(fileRef),new)
## compareCols(readRDS(fileRef),new)
})

test_that("reset removes unknown",{
Expand Down
15 changes: 12 additions & 3 deletions tests/testthat/test_NMreadExt.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ test_that("basic - all",{
if(F){
ref <- readRDS(fileRef)
compareCols(ref,res)
compareCols(ref$pars,res$pars)
}

})
Expand All @@ -46,6 +47,7 @@ test_that("basic - all from multiple models",{
if(F){
ref <- readRDS(fileRef)
compareCols(ref,res)
compareCols(ref$pars,res$pars)
}

})
Expand All @@ -61,9 +63,8 @@ test_that("muref - all",{

if(F){
ref <- readRDS(fileRef)
res
ref

compareCols(ref,res)
compareCols(ref$pars,res$pars)
}


Expand All @@ -76,6 +77,14 @@ test_that("muref SAEM - all",{

res <- NMreadExt(file=file.ext,as.fun="data.table",return="all")
expect_equal_to_reference(res,fileRef)

if(F){
ref <- readRDS(fileRef)
compareCols(ref,res)
compareCols(ref$pars,res$pars)
}


})

test_that("muref SAEM - tableno options",{
Expand Down
6 changes: 6 additions & 0 deletions tests/testthat/test_NMrelate.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ test_that("merge with NMreadExt results",{
)

expect_equal_to_reference(res,fileRef)

if(F){
ref <- readRDS(fileRef)
compareCols(ref$ext.nofix, res$ext.nofix)

}

})

Expand Down

0 comments on commit 2430d1d

Please sign in to comment.