-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5639f07
commit 6934c15
Showing
22 changed files
with
214 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
Package: openmpp | ||
Title: Programmatic Interface to OpenM++ | ||
Version: 0.0.0.9000 | ||
Version: 0.0.1 | ||
Authors@R: | ||
person("Matthew T.", "Warkentin", , "[email protected]", role = c("aut", "cre"), | ||
comment = c(ORCID = "0000-0001-8730-3511")) | ||
Description: A programmatic interface to the OpenM++ microsimulation platform. | ||
License: MIT + file LICENSE | ||
Encoding: UTF-8 | ||
Roxygen: list(markdown = TRUE) | ||
RoxygenNote: 7.2.3 | ||
RoxygenNote: 7.3.2.9000 | ||
Depends: | ||
R (>= 4.1.0) | ||
Imports: | ||
|
@@ -30,6 +30,11 @@ BugReports: https://github.com/oncology-outcomes/openmpp/issues | |
Collate: | ||
'APIConnections.R' | ||
'Admin.R' | ||
'Utils.R' | ||
'ClassModel.R' | ||
'ClassModelRun.R' | ||
'ClassModelRunSet.R' | ||
'ClassWorkset.R' | ||
'Downloads.R' | ||
'ModelExtras.R' | ||
'ModelMetadata.R' | ||
|
@@ -39,11 +44,6 @@ Collate: | |
'ModelWorkset.R' | ||
'OutputTables.R' | ||
'Parameters.R' | ||
'Utils.R' | ||
'R6ClassModel.R' | ||
'R6ClassModelRun.R' | ||
'R6ClassModelRunSet.R' | ||
'R6ClassWorkset.R' | ||
'RunMicrodata.R' | ||
'RunModels.R' | ||
'RunOptions.R' | ||
|
@@ -53,3 +53,6 @@ Collate: | |
'User.R' | ||
'openmpp-package.R' | ||
'zzz.R' | ||
Suggests: | ||
testthat (>= 3.0.0) | ||
Config/testthat/edition: 3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This file is part of the standard setup for testthat. | ||
# It is recommended that you do not modify it. | ||
# | ||
# Where should you do additional test configuration? | ||
# Learn more about the roles of various files in: | ||
# * https://r-pkgs.org/testing-design.html#sec-tests-files-overview | ||
# * https://testthat.r-lib.org/articles/special-files.html | ||
|
||
library(testthat) | ||
library(openmpp) | ||
|
||
test_check("openmpp") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
test_that("Should fail with no API connection", { | ||
expect_error(get_models()) | ||
expect_error(get_models_list()) | ||
}) | ||
|
||
test_that("Should work with no API connection", { | ||
skip_on_cran() | ||
skip_on_ci() | ||
use_OpenMpp_remote() | ||
expect_no_error(get_models()) | ||
expect_no_error(get_models_list()) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
test_that("Tests OpenMppModel class", { | ||
skip_on_cran() | ||
skip_on_ci() | ||
|
||
# Setup | ||
use_OpenMpp_remote() | ||
model_name <- get_models()$Name[[1]] | ||
model <- load_model(model_name) | ||
|
||
# Test | ||
expect_type(model, 'environment') | ||
expect_s3_class(model, c("OpenMppModel", "R6"), TRUE) | ||
expect_s3_class(model$TablesInfo, 'data.frame') | ||
expect_s3_class(model$ParamsInfo, 'data.frame') | ||
expect_s3_class(model$ModelTasks, 'data.frame') | ||
expect_s3_class(model$ModelRuns, 'data.frame') | ||
expect_s3_class(model$ModelScenarios, 'data.frame') | ||
expect_s3_class(model$ModelWorksets, 'data.frame') | ||
expect_type(model$ModelMetadata, 'list') | ||
expect_type(model$ModelVersion, 'character') | ||
expect_type(model$ModelName, 'character') | ||
expect_type(model$ModelDigest, 'character') | ||
expect_type(model$OpenMppType, 'character') | ||
expect_equal(model$OpenMppType, 'Model') | ||
expect_output(model$print()) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
test_that("Tests OpenMppModelRun class", { | ||
skip_on_cran() | ||
skip_on_ci() | ||
|
||
# Setup | ||
use_OpenMpp_remote() | ||
model_name <- get_models()$Name[[1]] | ||
run_name <- get_model_runs(model_name)$Name[[1]] | ||
run <- load_model_run(model_name, run_name) | ||
|
||
# Tests | ||
expect_no_error(load_run(model_name, run_name)) | ||
expect_type(run, 'environment') | ||
expect_s3_class(run, c("OpenMppModelRun", "OpenMppModel", "R6"), TRUE) | ||
expect_s3_class(run$TablesInfo, 'data.frame') | ||
expect_s3_class(run$ParamsInfo, 'data.frame') | ||
expect_s3_class(run$ModelTasks, 'data.frame') | ||
expect_s3_class(run$ModelRuns, 'data.frame') | ||
expect_s3_class(run$ModelScenarios, 'data.frame') | ||
expect_s3_class(run$ModelWorksets, 'data.frame') | ||
expect_type(run$Parameters, 'environment') | ||
expect_type(run$Tables, 'environment') | ||
expect_type(run$ModelMetadata, 'list') | ||
expect_type(run$RunMetadata, 'list') | ||
expect_type(run$ModelVersion, 'character') | ||
expect_type(run$ModelName, 'character') | ||
expect_type(run$RunName, 'character') | ||
expect_type(run$ModelDigest, 'character') | ||
expect_type(run$RunDigest, 'character') | ||
expect_type(run$RunStamp, 'character') | ||
expect_type(run$RunStatus, 'character') | ||
expect_type(run$RunStatusInfo, 'list') | ||
expect_type(run$OpenMppType, 'character') | ||
expect_type(run$RunDigest, 'character') | ||
expect_equal(run$OpenMppType, 'ModelRun') | ||
expect_output(run$print()) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
test_that("Tests OpenMppModelRunSet class", { | ||
skip_on_cran() | ||
skip_on_ci() | ||
|
||
# Setup | ||
use_OpenMpp_remote() | ||
model_name <- get_models()$Name[[1]] | ||
run_name <- get_model_runs(model_name)$Name[[1]] | ||
runset <- load_model_runs(model_name, c(run_name, run_name)) | ||
|
||
# Tests | ||
expect_no_error(load_runs(model_name, c(run_name, run_name))) | ||
expect_type(runset, 'environment') | ||
expect_s3_class(runset, c("OpenMppModelRunSet", "R6"), TRUE) | ||
expect_type(runset$Tables, 'environment') | ||
expect_type(runset$RunMetadatas, 'list') | ||
expect_type(runset$RunStatuses, 'character') | ||
expect_type(runset$RunStamps, 'character') | ||
expect_type(runset$RunDigests, 'character') | ||
expect_type(runset$RunNames, 'character') | ||
expect_type(runset$OpenMppType, 'character') | ||
expect_equal(runset$OpenMppType, 'ModelRunSet') | ||
expect_type(runset$ModelVersion, 'character') | ||
expect_type(runset$ModelName, 'character') | ||
expect_type(runset$ModelDigest, 'character') | ||
expect_output(runset$print()) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
test_that("Tests OpenMppWorkset class", { | ||
skip_on_cran() | ||
skip_on_ci() | ||
|
||
# Setup | ||
use_OpenMpp_remote() | ||
model_name <- get_models()$Name[[1]] | ||
workset_name <- get_worksets(model_name)$Name[[1]] | ||
workset <- load_workset(model_name, workset_name) | ||
|
||
# Tests | ||
expect_no_error(load_scenario(model_name, workset_name)) | ||
expect_type(workset, 'environment') | ||
expect_s3_class(workset, c("OpenMppWorkset", "OpenMppModel", "R6"), TRUE) | ||
expect_s3_class(workset$TablesInfo, 'data.frame') | ||
expect_s3_class(workset$ParamsInfo, 'data.frame') | ||
expect_s3_class(workset$ModelTasks, 'data.frame') | ||
expect_s3_class(workset$ModelRuns, 'data.frame') | ||
expect_s3_class(workset$ModelScenarios, 'data.frame') | ||
expect_s3_class(workset$ModelWorksets, 'data.frame') | ||
expect_type(workset$Parameters, 'environment') | ||
expect_type(workset$ModelMetadata, 'list') | ||
expect_type(workset$WorksetMetadata, 'list') | ||
expect_type(workset$ModelVersion, 'character') | ||
expect_type(workset$ModelName, 'character') | ||
expect_type(workset$WorksetName, 'character') | ||
expect_type(workset$ModelDigest, 'character') | ||
expect_type(workset$OpenMppType, 'character') | ||
expect_type(workset$BaseRunDigest, 'character') | ||
expect_type(workset$ReadOnly, 'logical') | ||
expect_equal(workset$OpenMppType, 'Workset') | ||
expect_output(workset$print()) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
test_that("Get model", { | ||
skip_on_cran() | ||
skip_on_ci() | ||
model_name <- get_models()$Name[[1]] | ||
expect_type(get_model(model_name), 'list') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
test_that("Test model run accessors", { | ||
skip_on_cran() | ||
skip_on_ci() | ||
model_name <- get_models()$Name[[1]] | ||
run_name <- get_model_runs(model_name)$Name[[1]] | ||
expect_type(get_run(model_name, run_name), 'list') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
test_that("Get workset", { | ||
skip_on_cran() | ||
skip_on_ci() | ||
model_name <- get_models()$Name[[1]] | ||
workset_name <- get_worksets(model_name)$Name[[1]] | ||
expect_type(get_workset(model_name, workset_name), 'list') | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
test_that("Test run options", { | ||
skip_on_cran() | ||
skip_on_ci() | ||
opts <- opts_run() | ||
expect_s3_class(opts, c("OpenMppRunOpts", "list")) | ||
expect_output(print(opts)) | ||
}) |