Skip to content

Commit

Permalink
Done 'check_experiment', progress #69
Browse files Browse the repository at this point in the history
  • Loading branch information
richelbilderbeek committed Jan 31, 2019
1 parent 649add0 commit 3c46813
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
24 changes: 22 additions & 2 deletions R/check_experiment.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,26 @@ check_experiment <- function(
if (!experiment$do_measure_evidence %in% c(TRUE, FALSE)) {
stop("'do_measure_evidence' must be either TRUE or FALSE")
}
beautier::check_inference_model(experiment$inference_model)
beastier::check_beast2_options(experiment$beast2_options)
tryCatch(
beautier::check_inference_model(experiment$inference_model),
error = function(e) {
stop(
"'inference_model' must be a valid inference model\n",
"Tip: use 'beautier::create_inference_model'.\n",
"Error: ", e$message, "\n",
"Value: ", experiment$inference_model
)
}
)
tryCatch(
beastier::check_beast2_options(experiment$beast2_options),
error = function(e) {
stop(
"'beast2_options' must be valid BEAST2 options.\n",
"Tip: use 'beastier::create_beast2_options'.\n",
"Error: ", e$message, "\n",
"Value: ", experiment$beast2_options
)
}
)
}
3 changes: 1 addition & 2 deletions tests/testthat/test-check_experiment.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ test_that("wrong parameter values", {
),
"'do_measure_evidence' must be either TRUE or FALSE"
)
skip("WIP, #69")
expect_error(
check_experiment(
create_experiment(
Expand All @@ -89,7 +88,7 @@ test_that("wrong parameter values", {
beast2_options = "nonsense"
)
),
"'beast2_options' must be a valid inference model"
"'beast2_options' must be valid BEAST2 options"
)

})

0 comments on commit 3c46813

Please sign in to comment.