-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add postprocessors to tunable * units tests for tunable postproc and some work on #194 * required for calibration * Update tests/testthat/test-generics.R Co-authored-by: Simon P. Couch <[email protected]> --------- Co-authored-by: Simon P. Couch <[email protected]>
- Loading branch information
1 parent
cd34921
commit 784d0fd
Showing
4 changed files
with
167 additions
and
0 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
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,25 @@ | ||
check_tunable <- function(x) { | ||
expect_equal(names(x), c("name", "call_info", "source", "component", "component_id")) | ||
expect_equal(class(x$name), "character") | ||
expect_equal(class(x$call_info), "list") | ||
expect_equal(class(x$source), "character") | ||
expect_equal(class(x$component), "character") | ||
expect_equal(class(x$component_id), "character") | ||
|
||
for (i in seq_along(x$call_info)) { | ||
check_call_info(x$call_info[[i]]) | ||
} | ||
|
||
invisible(TRUE) | ||
} | ||
|
||
check_call_info <- function(x) { | ||
if (all(is.null(x))) { | ||
# it is possible that engine parameter do not have call info | ||
return(invisible(TRUE)) | ||
} | ||
expect_true(all(c("pkg", "fun") %in% names(x))) | ||
expect_equal(class(x$pkg), "character") | ||
expect_equal(class(x$fun), "character") | ||
invisible(TRUE) | ||
} |
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
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