diff --git a/NAMESPACE b/NAMESPACE index b9709e7e..f417d201 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -27,6 +27,7 @@ export(check_submission_metadata_file_exists) export(check_submission_time) export(check_tbl_col_types) export(check_tbl_colnames) +export(check_tbl_derived_task_id_vals) export(check_tbl_match_round_id) export(check_tbl_rows_unique) export(check_tbl_spl_compound_taskid_set) diff --git a/NEWS.md b/NEWS.md index 65b748f2..4f25d8b8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,6 @@ # hubValidations (development version) +* Added `check_tbl_derived_task_id_vals()` check to `validate_model_data()` that ensures that values in derived task ID columns match expected values for the corresponding derived task IDs in the round as defined in `tasks.json` config (#110). Given the dependence of derived task IDs on the values of their source task ID values, the check ignores the combinations of derived task ID values with those of other task IDs and focuses only on identifying values that do not match corresponding accepted values. * `submission_tmpl()` gains the `force_output_types` allowing users to force optional output types to be included in a submission template when `required_vals_only = TRUE`. In conjunction with the use of the `output_types` argument, this allows users to create submission templates which include optional output types they plan to submit. * `check_tbl_values_required()` no longer reports false positives for v4 hubs, which fixes the bug reported in #177. Evaluation of whether all combinations of required values have been submitted through `check_tbl_values_required()` is now chunked by output type for v4 config and above. This reduces memory pressure and should speed up required value validation in hubs with complex task.json files. diff --git a/R/check_tbl_derived_task_id_vals.R b/R/check_tbl_derived_task_id_vals.R new file mode 100644 index 00000000..8efd824a --- /dev/null +++ b/R/check_tbl_derived_task_id_vals.R @@ -0,0 +1,86 @@ +#' Check derived task ID columns contain valid values +#' +#' This check is used to validate that values in any derived task ID columns +#' matches accepted values for each derived task ID in the config. +#' Given the dependence of derived task IDs on the values of other values, +#' it ignores the combinations of derived task ID values with those of other task IDs +#' and focuses only on identifying values that do not match the accepted values. +#' @param tbl a tibble/data.frame of the contents of the file being validated. Column types must **all be character**. +#' @inherit check_tbl_colnames params +#' @inheritParams expand_model_out_grid +#' @return +#' Depending on whether validation has succeeded, one of: +#' - `` condition class object. +#' - `` condition class object. +#' +#' If no `derived_task_ids` are specified, the check is skipped and a +#' `` condition class object is retuned. +#' +#' Returned object also inherits from subclass ``. +#' @export +check_tbl_derived_task_id_vals <- function( + tbl, round_id, file_path, hub_path, + derived_task_ids = get_hub_derived_task_ids( + hub_path, round_id + )) { + if (is.null(derived_task_ids)) { + return( + capture_check_info( + file_path = file_path, + msg = "No derived task IDs to check. Skipping derived task ID value check." + ) + ) + } + config_tasks <- read_config(hub_path, "tasks") + + derived_task_id_vals <- get_round_config_values( + config_tasks = config_tasks, + round_id = round_id, + derived_task_ids = NULL + )[derived_task_ids] + + setdiff_vals <- purrr::map2( + tbl[derived_task_ids], derived_task_id_vals, setdiff + ) + + invalid_derived_task_ids <- lengths(setdiff_vals) > 0L + + check <- !any(invalid_derived_task_ids) + + if (check) { + details <- NULL + errors <- NULL + } else { + invalid_vals <- setdiff_vals[invalid_derived_task_ids] + invalid_vals_msg <- purrr::map_chr( + seq_along(invalid_vals), + \(.x) { + paste0( + "{.arg {names(invalid_vals)[", .x, + "]}}: {.val {invalid_vals[[", .x, "]]}}" + ) + } + ) + details <- c( + invalid_vals_msg, + "see {.code errors} for more details." + ) |> + paste(collapse = ", ") |> + cli::format_inline() + errors <- invalid_vals + } + + capture_check_cnd( + check = check, + file_path = file_path, + msg_subject = "{.var tbl}", + msg_attribute = "", + msg_verbs = c( + "contains valid derived task ID values.", + "contains invalid derived task ID values." + ), + errors = errors, + error = FALSE, + details = details + ) +} diff --git a/R/validate_model_data.R b/R/validate_model_data.R index 6a3ab062..5b16cf6a 100644 --- a/R/validate_model_data.R +++ b/R/validate_model_data.R @@ -170,6 +170,16 @@ validate_model_data <- function(hub_path, file_path, round_id_col = NULL, return(checks) } + checks$derived_task_id_vals <- try_check( + check_tbl_derived_task_id_vals( + tbl_chr, + round_id = round_id, + file_path = file_path, + hub_path = hub_path, + derived_task_ids = derived_task_ids + ), file_path + ) + checks$rows_unique <- try_check( check_tbl_rows_unique( tbl_chr, diff --git a/inst/check_table.csv b/inst/check_table.csv index bd983014..c40bafb0 100644 --- a/inst/check_table.csv +++ b/inst/check_table.csv @@ -14,9 +14,10 @@ unique_round_id,Round ID column contains a single unique round ID. Skipped if `r match_round_id,Round ID from file contents matches round ID from file name. Skipped if `round_id_from_var` is FALSE in config.,TRUE,check_error,validate_model_data,check_tbl_match_round_id,,FALSE colnames,File column names match expected column names for round (i.e. task ID names + hub standard column names),TRUE,check_error,validate_model_data,check_tbl_colnames,,FALSE col_types,File column types match expected column types from config. Mainly applicable to parquet & arrow files.,FALSE,check_failure,validate_model_data,check_tbl_col_types,,FALSE -valid_vals,Columns (excluding `value` column) contain valid combinations of task ID / output type / output type ID values,TRUE,check_error,validate_model_data,check_tbl_values,error_tbl: table of invalid task ID/output type/output type ID value combinations,FALSE -rows_unique,Columns (excluding `value` column) contain unique combinations of task ID / output type / output type ID values,FALSE,check_failure,validate_model_data,check_tbl_rows_unique,,FALSE -req_vals,Columns (excluding `value` column) contain all required combinations of task ID / output type / output type ID values,FALSE,check_failure,validate_model_data,check_tbl_values_required,missing_df: table of missing task ID/output type/output type ID value combinations,FALSE +valid_vals,Columns (excluding the `value` and any derived task ID columns) contain valid combinations of task ID / output type / output type ID values,TRUE,check_error,validate_model_data,check_tbl_values,error_tbl: table of invalid task ID/output type/output type ID value combinations,FALSE +derived_task_id_vals,Derived task ID columns contain valid values.,FALSE,check_failure,validate_model_data,check_tbl_derived_task_id_vals,errors: named list of derived task ID values. Each element contains the invalid values for each derived task ID that failed the check.,FALSE +rows_unique,Columns (excluding the `value` and any derived task ID columns) contain unique combinations of task ID / output type / output type ID values,FALSE,check_failure,validate_model_data,check_tbl_rows_unique,,FALSE +req_vals,Columns (excluding the `value` and any derived task ID columns) contain all required combinations of task ID / output type / output type ID values,FALSE,check_failure,validate_model_data,check_tbl_values_required,missing_df: table of missing task ID/output type/output type ID value combinations,FALSE value_col_valid,Values in `value` column are coercible to data type configured for each output type,FALSE,check_failure,validate_model_data,check_tbl_value_col,,FALSE value_col_non_desc,Values in `value` column are non-decreasing as output_type_ids increase for all unique task ID /output type value combinations. Applies to `quantile` or `cdf` output types only,FALSE,check_failure,validate_model_data,check_tbl_value_col_ascending,error_tbl: table of rows affected,FALSE value_col_sum1,Values in the `value` column of `pmf` output type data for each unique task ID combination sum to 1.,FALSE,check_failure,validate_model_data,check_tbl_value_col_sum1,error_tbl: table of rows affected,FALSE diff --git a/man/check_tbl_derived_task_id_vals.Rd b/man/check_tbl_derived_task_id_vals.Rd new file mode 100644 index 00000000..4e720fee --- /dev/null +++ b/man/check_tbl_derived_task_id_vals.Rd @@ -0,0 +1,56 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/check_tbl_derived_task_id_vals.R +\name{check_tbl_derived_task_id_vals} +\alias{check_tbl_derived_task_id_vals} +\title{Check derived task ID columns contain valid values} +\usage{ +check_tbl_derived_task_id_vals( + tbl, + round_id, + file_path, + hub_path, + derived_task_ids = get_hub_derived_task_ids(hub_path, round_id) +) +} +\arguments{ +\item{tbl}{a tibble/data.frame of the contents of the file being validated. Column types must \strong{all be character}.} + +\item{round_id}{character string. The round identifier.} + +\item{file_path}{character string. Path to the file being validated relative to +the hub's model-output directory.} + +\item{hub_path}{Either a character string path to a local Modeling Hub directory +or an object of class \verb{} created using functions \code{\link[hubData:s3_bucket]{s3_bucket()}} +or \code{\link[hubData:gs_bucket]{gs_bucket()}} by providing a string S3 or GCS bucket name or path to a +Modeling Hub directory stored in the cloud. +For more details consult the +\href{https://arrow.apache.org/docs/r/articles/fs.html}{Using cloud storage (S3, GCS)} +in the \code{arrow} package. +The hub must be fully configured with valid \code{admin.json} and \code{tasks.json} +files within the \code{hub-config} directory.} + +\item{derived_task_ids}{Character vector of derived task ID names (task IDs whose +values depend on other task IDs) to ignore. Columns for such task ids will +contain \code{NA}s. Defaults to extracting derived task IDs from \code{config_tasks}. See +\code{\link[=get_config_derived_task_ids]{get_config_derived_task_ids()}} for more details.} +} +\value{ +Depending on whether validation has succeeded, one of: +\itemize{ +\item \verb{} condition class object. +\item \verb{} condition class object. +} + +If no \code{derived_task_ids} are specified, the check is skipped and a +\verb{} condition class object is retuned. + +Returned object also inherits from subclass \verb{}. +} +\description{ +This check is used to validate that values in any derived task ID columns +matches accepted values for each derived task ID in the config. +Given the dependence of derived task IDs on the values of other values, +it ignores the combinations of derived task ID values with those of other task IDs +and focuses only on identifying values that do not match the accepted values. +} diff --git a/man/validate_model_data.Rd b/man/validate_model_data.Rd index 58003cf9..fbe71e38 100644 --- a/man/validate_model_data.Rd +++ b/man/validate_model_data.Rd @@ -133,21 +133,28 @@ Details of checks performed by \code{validate_model_data()}\if{html}{\out{ valid_vals - Columns (excluding `value` column) contain valid combinations of task ID / output type / output type ID values + Columns (excluding the `value` and any derived task ID columns) contain valid combinations of task ID / output type / output type ID values TRUE check_error error_tbl: table of invalid task ID/output type/output type ID value combinations + + derived_task_id_vals + Derived task ID columns contain valid values. + FALSE + check_failure + errors: named list of derived task ID values. Each element contains the invalid values for each derived task ID that failed the check. + rows_unique - Columns (excluding `value` column) contain unique combinations of task ID / output type / output type ID values + Columns (excluding the `value` and any derived task ID columns) contain unique combinations of task ID / output type / output type ID values FALSE check_failure req_vals - Columns (excluding `value` column) contain all required combinations of task ID / output type / output type ID values + Columns (excluding the `value` and any derived task ID columns) contain all required combinations of task ID / output type / output type ID values FALSE check_failure missing_df: table of missing task ID/output type/output type ID value combinations diff --git a/man/validate_pr.Rd b/man/validate_pr.Rd index 7565a163..6f37a517 100644 --- a/man/validate_pr.Rd +++ b/man/validate_pr.Rd @@ -250,21 +250,28 @@ Details of checks performed by \code{validate_submission()}\if{html}{\out{ - + + + + + + + + - + - + diff --git a/man/validate_submission.Rd b/man/validate_submission.Rd index 70c28b7e..6c9b0dd8 100644 --- a/man/validate_submission.Rd +++ b/man/validate_submission.Rd @@ -215,21 +215,28 @@ Details of checks performed by \code{validate_submission()}\if{html}{\out{ - + + + + + + + + - + - + diff --git a/tests/testthat/_snaps/check_tbl_derived_task_id_vals.md b/tests/testthat/_snaps/check_tbl_derived_task_id_vals.md new file mode 100644 index 00000000..66df009c --- /dev/null +++ b/tests/testthat/_snaps/check_tbl_derived_task_id_vals.md @@ -0,0 +1,28 @@ +# check_tbl_derived_task_ids_vals works + + Code + check_tbl_derived_task_id_vals(tbl, round_id, file_path, hub_path) + Output + + Message: + `tbl` contains valid derived task ID values. + +--- + + Code + check_tbl_derived_task_id_vals(tbl, round_id, file_path, hub_path, + derived_task_ids = NULL) + Output + + Message: + No derived task IDs to check. Skipping derived task ID value check. + +--- + + Code + check_tbl_derived_task_id_vals(tbl, round_id, file_path, hub_path) + Output + + Error: + ! `tbl` contains invalid derived task ID values. `target_date`: "random_val", see `errors` for more details. + diff --git a/tests/testthat/_snaps/validate_model_data.md b/tests/testthat/_snaps/validate_model_data.md index 3ce9d79f..9b51d020 100644 --- a/tests/testthat/_snaps/validate_model_data.md +++ b/tests/testthat/_snaps/validate_model_data.md @@ -3,57 +3,63 @@ Code str(validate_model_data(hub_path, file_path)) Output - List of 12 - $ file_read :List of 4 + List of 13 + $ file_read :List of 4 ..$ message : chr "File could be read successfully. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_file_read" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ valid_round_id_col:List of 4 + $ valid_round_id_col :List of 4 ..$ message : chr "`round_id_col` name is valid. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_valid_round_id_col" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ unique_round_id :List of 4 + $ unique_round_id :List of 4 ..$ message : chr "`round_id` column \"origin_date\" contains a single, unique round ID value. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_unique_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ match_round_id :List of 4 + $ match_round_id :List of 4 ..$ message : chr "All `round_id_col` \"origin_date\" values match submission `round_id` from file name. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_match_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ colnames :List of 4 + $ colnames :List of 4 ..$ message : chr "Column names are consistent with expected round task IDs and std column names. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_colnames" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ col_types :List of 4 + $ col_types :List of 4 ..$ message : chr "Column data types match hub schema. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_col_types" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ valid_vals :List of 5 + $ valid_vals :List of 5 ..$ message : chr "`tbl` contains valid values/value combinations. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ error_tbl : NULL ..$ call : chr "check_tbl_values" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ rows_unique :List of 4 + $ derived_task_id_vals:List of 4 + ..$ message : chr "No derived task IDs to check. Skipping derived task ID value check." + ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" + ..$ call : chr "check_tbl_derived_task_id_vals" + ..$ use_cli_format: logi TRUE + ..- attr(*, "class")= chr [1:5] "check_info" "hub_check" "rlang_message" "message" ... + $ rows_unique :List of 4 ..$ message : chr "All combinations of task ID column/`output_type`/`output_type_id` values are unique. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_rows_unique" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ req_vals :List of 5 + $ req_vals :List of 5 ..$ message : chr "Required task ID/output type/output type ID combinations all present. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ missing : tibble [0 x 6] (S3: tbl_df/tbl/data.frame) @@ -66,20 +72,20 @@ ..$ call : chr "check_tbl_values_required" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_valid :List of 4 + $ value_col_valid :List of 4 ..$ message : chr "Values in column `value` all valid with respect to modeling task config. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_value_col" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_non_desc:List of 5 + $ value_col_non_desc :List of 5 ..$ message : chr "Values in `value` column are non-decreasing as output_type_ids increase for all unique task ID\n value/outpu"| __truncated__ ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ error_tbl : NULL ..$ call : chr "check_tbl_value_col_ascending" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_sum1 :List of 4 + $ value_col_sum1 :List of 4 ..$ message : chr "No pmf output types to check for sum of 1. Check skipped." ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_value_col_sum1" @@ -136,57 +142,63 @@ Code str(validate_model_data(hub_path, file_path)) Output - List of 12 - $ file_read :List of 4 + List of 13 + $ file_read :List of 4 ..$ message : chr "File could be read successfully. \n " ..$ where : chr "hub-ensemble/2023-05-08-hub-ensemble.parquet" ..$ call : chr "check_file_read" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ valid_round_id_col:List of 4 + $ valid_round_id_col :List of 4 ..$ message : chr "`round_id_col` name is valid. \n " ..$ where : chr "hub-ensemble/2023-05-08-hub-ensemble.parquet" ..$ call : chr "check_valid_round_id_col" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ unique_round_id :List of 4 + $ unique_round_id :List of 4 ..$ message : chr "`round_id` column \"forecast_date\" contains a single, unique round ID value. \n " ..$ where : chr "hub-ensemble/2023-05-08-hub-ensemble.parquet" ..$ call : chr "check_tbl_unique_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ match_round_id :List of 4 + $ match_round_id :List of 4 ..$ message : chr "All `round_id_col` \"forecast_date\" values match submission `round_id` from file name. \n " ..$ where : chr "hub-ensemble/2023-05-08-hub-ensemble.parquet" ..$ call : chr "check_tbl_match_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ colnames :List of 4 + $ colnames :List of 4 ..$ message : chr "Column names are consistent with expected round task IDs and std column names. \n " ..$ where : chr "hub-ensemble/2023-05-08-hub-ensemble.parquet" ..$ call : chr "check_tbl_colnames" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ col_types :List of 4 + $ col_types :List of 4 ..$ message : chr "Column data types match hub schema. \n " ..$ where : chr "hub-ensemble/2023-05-08-hub-ensemble.parquet" ..$ call : chr "check_tbl_col_types" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ valid_vals :List of 5 + $ valid_vals :List of 5 ..$ message : chr "`tbl` contains valid values/value combinations. \n " ..$ where : chr "hub-ensemble/2023-05-08-hub-ensemble.parquet" ..$ error_tbl : NULL ..$ call : chr "check_tbl_values" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ rows_unique :List of 4 + $ derived_task_id_vals:List of 4 + ..$ message : chr "No derived task IDs to check. Skipping derived task ID value check." + ..$ where : chr "hub-ensemble/2023-05-08-hub-ensemble.parquet" + ..$ call : chr "check_tbl_derived_task_id_vals" + ..$ use_cli_format: logi TRUE + ..- attr(*, "class")= chr [1:5] "check_info" "hub_check" "rlang_message" "message" ... + $ rows_unique :List of 4 ..$ message : chr "All combinations of task ID column/`output_type`/`output_type_id` values are unique. \n " ..$ where : chr "hub-ensemble/2023-05-08-hub-ensemble.parquet" ..$ call : chr "check_tbl_rows_unique" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ req_vals :List of 5 + $ req_vals :List of 5 ..$ message : chr "Required task ID/output type/output type ID combinations all present. \n " ..$ where : chr "hub-ensemble/2023-05-08-hub-ensemble.parquet" ..$ missing : tibble [0 x 6] (S3: tbl_df/tbl/data.frame) @@ -199,20 +211,20 @@ ..$ call : chr "check_tbl_values_required" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_valid :List of 4 + $ value_col_valid :List of 4 ..$ message : chr "Values in column `value` all valid with respect to modeling task config. \n " ..$ where : chr "hub-ensemble/2023-05-08-hub-ensemble.parquet" ..$ call : chr "check_tbl_value_col" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_non_desc:List of 5 + $ value_col_non_desc :List of 5 ..$ message : chr "Values in `value` column are non-decreasing as output_type_ids increase for all unique task ID\n value/outpu"| __truncated__ ..$ where : chr "hub-ensemble/2023-05-08-hub-ensemble.parquet" ..$ error_tbl : NULL ..$ call : chr "check_tbl_value_col_ascending" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_sum1 :List of 4 + $ value_col_sum1 :List of 4 ..$ message : chr "No pmf output types to check for sum of 1. Check skipped." ..$ where : chr "hub-ensemble/2023-05-08-hub-ensemble.parquet" ..$ call : chr "check_tbl_value_col_sum1" @@ -255,6 +267,7 @@ v [colnames]: Column names are consistent with expected round task IDs and std column names. v [col_types]: Column data types match hub schema. v [valid_vals]: `tbl` contains valid values/value combinations. + i [derived_task_id_vals]: No derived task IDs to check. Skipping derived task ID value check. v [rows_unique]: All combinations of task ID column/`output_type`/`output_type_id` values are unique. v [req_vals]: Required task ID/output type/output type ID combinations all present. v [value_col_valid]: Values in column `value` all valid with respect to modeling task config. @@ -276,6 +289,7 @@ v [colnames]: Column names are consistent with expected round task IDs and std column names. v [col_types]: Column data types match hub schema. v [valid_vals]: `tbl` contains valid values/value combinations. + i [derived_task_id_vals]: No derived task IDs to check. Skipping derived task ID value check. v [rows_unique]: All combinations of task ID column/`output_type`/`output_type_id` values are unique. v [req_vals]: Required task ID/output type/output type ID combinations all present. v [value_col_valid]: Values in column `value` all valid with respect to modeling task config. @@ -297,6 +311,7 @@ ✔ [colnames]: Column names are consistent with expected round task IDs and std column names. ✔ [col_types]: Column data types match hub schema. ✔ [valid_vals]: `tbl` contains valid values/value combinations. + ℹ [derived_task_id_vals]: No derived task IDs to check. Skipping derived task ID value check. ✔ [rows_unique]: All combinations of task ID column/`output_type`/`output_type_id` values are unique. ✔ [req_vals]: Required task ID/output type/output type ID combinations all present. ✔ [value_col_valid]: Values in column `value` all valid with respect to modeling task config. @@ -318,6 +333,7 @@ ✔ [colnames]: Column names are consistent with expected round task IDs and std column names. ✔ [col_types]: Column data types match hub schema. ✔ [valid_vals]: `tbl` contains valid values/value combinations. + ℹ [derived_task_id_vals]: No derived task IDs to check. Skipping derived task ID value check. ✔ [rows_unique]: All combinations of task ID column/`output_type`/`output_type_id` values are unique. ✔ [req_vals]: Required task ID/output type/output type ID combinations all present. ✔ [value_col_valid]: Values in column `value` all valid with respect to modeling task config. @@ -339,7 +355,7 @@ file_path = "flu-base/2022-10-22-flu-base.csv", validations_cfg_path = system.file( "testhubs/samples/hub-config/validations.yml", package = "hubValidations"))) Output - List of 17 + List of 18 $ file_read :List of 4 ..$ message : chr "File could be read successfully. \n " ..$ where : chr "flu-base/2022-10-22-flu-base.csv" @@ -383,6 +399,12 @@ ..$ call : chr "check_tbl_values" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... + $ derived_task_id_vals :List of 4 + ..$ message : chr "No derived task IDs to check. Skipping derived task ID value check." + ..$ where : chr "flu-base/2022-10-22-flu-base.csv" + ..$ call : chr "check_tbl_derived_task_id_vals" + ..$ use_cli_format: logi TRUE + ..- attr(*, "class")= chr [1:5] "check_info" "hub_check" "rlang_message" "message" ... $ rows_unique :List of 4 ..$ message : chr "All combinations of task ID column/`output_type`/`output_type_id` values are unique. \n " ..$ where : chr "flu-base/2022-10-22-flu-base.csv" diff --git a/tests/testthat/_snaps/validate_pr.md b/tests/testthat/_snaps/validate_pr.md index 8ded696d..94555230 100644 --- a/tests/testthat/_snaps/validate_pr.md +++ b/tests/testthat/_snaps/validate_pr.md @@ -3,7 +3,7 @@ Code str(checks) Output - List of 24 + List of 25 $ valid_config :List of 4 ..$ message : chr "All hub config files are valid. \n " ..$ where : chr "valid_sb_hub" @@ -95,6 +95,12 @@ ..$ call : chr "check_tbl_values" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... + $ derived_task_id_vals :List of 4 + ..$ message : chr "No derived task IDs to check. Skipping derived task ID value check." + ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" + ..$ call : chr "check_tbl_derived_task_id_vals" + ..$ use_cli_format: logi TRUE + ..- attr(*, "class")= chr [1:5] "check_info" "hub_check" "rlang_message" "message" ... $ rows_unique :List of 4 ..$ message : chr "All combinations of task ID column/`output_type`/`output_type_id` values are unique. \n " ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" @@ -252,7 +258,7 @@ Code str(mod_checks_error) Output - List of 50 + List of 52 $ valid_config :List of 4 ..$ message : chr "All hub config files are valid. \n " ..$ where : chr "mod_del_hub" @@ -368,6 +374,12 @@ ..$ call : chr "check_tbl_values" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... + $ derived_task_id_vals :List of 4 + ..$ message : chr "No derived task IDs to check. Skipping derived task ID value check." + ..$ where : 'fs_path' chr "hub-baseline/2022-10-08-hub-baseline.csv" + ..$ call : chr "check_tbl_derived_task_id_vals" + ..$ use_cli_format: logi TRUE + ..- attr(*, "class")= chr [1:5] "check_info" "hub_check" "rlang_message" "message" ... $ rows_unique :List of 4 ..$ message : chr "All combinations of task ID column/`output_type`/`output_type_id` values are unique. \n " ..$ where : 'fs_path' chr "hub-baseline/2022-10-08-hub-baseline.csv" @@ -517,6 +529,12 @@ ..$ call : chr "check_tbl_values" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... + $ derived_task_id_vals_1 :List of 4 + ..$ message : chr "No derived task IDs to check. Skipping derived task ID value check." + ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" + ..$ call : chr "check_tbl_derived_task_id_vals" + ..$ use_cli_format: logi TRUE + ..- attr(*, "class")= chr [1:5] "check_info" "hub_check" "rlang_message" "message" ... $ rows_unique_1 :List of 4 ..$ message : chr "All combinations of task ID column/`output_type`/`output_type_id` values are unique. \n " ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" @@ -587,7 +605,7 @@ Code str(mod_checks_warn) Output - List of 50 + List of 52 $ valid_config :List of 4 ..$ message : chr "All hub config files are valid. \n " ..$ where : chr "mod_del_hub" @@ -703,6 +721,12 @@ ..$ call : chr "check_tbl_values" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... + $ derived_task_id_vals :List of 4 + ..$ message : chr "No derived task IDs to check. Skipping derived task ID value check." + ..$ where : 'fs_path' chr "hub-baseline/2022-10-08-hub-baseline.csv" + ..$ call : chr "check_tbl_derived_task_id_vals" + ..$ use_cli_format: logi TRUE + ..- attr(*, "class")= chr [1:5] "check_info" "hub_check" "rlang_message" "message" ... $ rows_unique :List of 4 ..$ message : chr "All combinations of task ID column/`output_type`/`output_type_id` values are unique. \n " ..$ where : 'fs_path' chr "hub-baseline/2022-10-08-hub-baseline.csv" @@ -852,6 +876,12 @@ ..$ call : chr "check_tbl_values" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... + $ derived_task_id_vals_1 :List of 4 + ..$ message : chr "No derived task IDs to check. Skipping derived task ID value check." + ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" + ..$ call : chr "check_tbl_derived_task_id_vals" + ..$ use_cli_format: logi TRUE + ..- attr(*, "class")= chr [1:5] "check_info" "hub_check" "rlang_message" "message" ... $ rows_unique_1 :List of 4 ..$ message : chr "All combinations of task ID column/`output_type`/`output_type_id` values are unique. \n " ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" @@ -922,7 +952,7 @@ Code str(mod_checks_message) Output - List of 50 + List of 52 $ valid_config :List of 4 ..$ message : chr "All hub config files are valid. \n " ..$ where : chr "mod_del_hub" @@ -1032,6 +1062,12 @@ ..$ call : chr "check_tbl_values" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... + $ derived_task_id_vals :List of 4 + ..$ message : chr "No derived task IDs to check. Skipping derived task ID value check." + ..$ where : 'fs_path' chr "hub-baseline/2022-10-08-hub-baseline.csv" + ..$ call : chr "check_tbl_derived_task_id_vals" + ..$ use_cli_format: logi TRUE + ..- attr(*, "class")= chr [1:5] "check_info" "hub_check" "rlang_message" "message" ... $ rows_unique :List of 4 ..$ message : chr "All combinations of task ID column/`output_type`/`output_type_id` values are unique. \n " ..$ where : 'fs_path' chr "hub-baseline/2022-10-08-hub-baseline.csv" @@ -1181,6 +1217,12 @@ ..$ call : chr "check_tbl_values" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... + $ derived_task_id_vals_1 :List of 4 + ..$ message : chr "No derived task IDs to check. Skipping derived task ID value check." + ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" + ..$ call : chr "check_tbl_derived_task_id_vals" + ..$ use_cli_format: logi TRUE + ..- attr(*, "class")= chr [1:5] "check_info" "hub_check" "rlang_message" "message" ... $ rows_unique_1 :List of 4 ..$ message : chr "All combinations of task ID column/`output_type`/`output_type_id` values are unique. \n " ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" @@ -1251,7 +1293,7 @@ Code str(mod_checks_none) Output - List of 47 + List of 49 $ valid_config :List of 4 ..$ message : chr "All hub config files are valid. \n " ..$ where : chr "mod_del_hub" @@ -1343,6 +1385,12 @@ ..$ call : chr "check_tbl_values" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... + $ derived_task_id_vals :List of 4 + ..$ message : chr "No derived task IDs to check. Skipping derived task ID value check." + ..$ where : 'fs_path' chr "hub-baseline/2022-10-08-hub-baseline.csv" + ..$ call : chr "check_tbl_derived_task_id_vals" + ..$ use_cli_format: logi TRUE + ..- attr(*, "class")= chr [1:5] "check_info" "hub_check" "rlang_message" "message" ... $ rows_unique :List of 4 ..$ message : chr "All combinations of task ID column/`output_type`/`output_type_id` values are unique. \n " ..$ where : 'fs_path' chr "hub-baseline/2022-10-08-hub-baseline.csv" @@ -1492,6 +1540,12 @@ ..$ call : chr "check_tbl_values" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... + $ derived_task_id_vals_1 :List of 4 + ..$ message : chr "No derived task IDs to check. Skipping derived task ID value check." + ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" + ..$ call : chr "check_tbl_derived_task_id_vals" + ..$ use_cli_format: logi TRUE + ..- attr(*, "class")= chr [1:5] "check_info" "hub_check" "rlang_message" "message" ... $ rows_unique_1 :List of 4 ..$ message : chr "All combinations of task ID column/`output_type`/`output_type_id` values are unique. \n " ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" @@ -1562,7 +1616,7 @@ Code str(mod_checks_in_window) Output - List of 49 + List of 51 $ valid_config :List of 4 ..$ message : chr "All hub config files are valid. \n " ..$ where : chr "mod_del_hub" @@ -1670,6 +1724,12 @@ ..$ call : chr "check_tbl_values" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... + $ derived_task_id_vals :List of 4 + ..$ message : chr "No derived task IDs to check. Skipping derived task ID value check." + ..$ where : 'fs_path' chr "hub-baseline/2022-10-08-hub-baseline.csv" + ..$ call : chr "check_tbl_derived_task_id_vals" + ..$ use_cli_format: logi TRUE + ..- attr(*, "class")= chr [1:5] "check_info" "hub_check" "rlang_message" "message" ... $ rows_unique :List of 4 ..$ message : chr "All combinations of task ID column/`output_type`/`output_type_id` values are unique. \n " ..$ where : 'fs_path' chr "hub-baseline/2022-10-08-hub-baseline.csv" @@ -1819,6 +1879,12 @@ ..$ call : chr "check_tbl_values" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... + $ derived_task_id_vals_1 :List of 4 + ..$ message : chr "No derived task IDs to check. Skipping derived task ID value check." + ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" + ..$ call : chr "check_tbl_derived_task_id_vals" + ..$ use_cli_format: logi TRUE + ..- attr(*, "class")= chr [1:5] "check_info" "hub_check" "rlang_message" "message" ... $ rows_unique_1 :List of 4 ..$ message : chr "All combinations of task ID column/`output_type`/`output_type_id` values are unique. \n " ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" @@ -1928,105 +1994,111 @@ Code str(checks) Output - List of 20 - $ valid_config :List of 4 + List of 21 + $ valid_config :List of 4 ..$ message : chr "All hub config files are valid. \n " ..$ where : chr "valid_sb_hub-old" ..$ call : chr "check_config_hub_valid" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_exists :List of 4 + $ file_exists :List of 4 ..$ message : chr "File exists at path 'model-output/team1-goodmodel/2022-10-22-team1-goodmodel.csv'. \n " ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" ..$ call : chr "check_file_exists" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_name :List of 4 + $ file_name :List of 4 ..$ message : chr "File name \"2022-10-22-team1-goodmodel.csv\" is valid. \n " ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" ..$ call : chr "check_file_name" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_location :List of 4 + $ file_location :List of 4 ..$ message : chr "File directory name matches `model_id`\n metadata in file name. \n " ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" ..$ call : chr "check_file_location" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ round_id_valid :List of 4 + $ round_id_valid :List of 4 ..$ message : chr "`round_id` is valid. \n " ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" ..$ call : chr "check_valid_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_format :List of 4 + $ file_format :List of 4 ..$ message : chr "File is accepted hub format. \n " ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" ..$ call : chr "check_file_format" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_n :List of 4 + $ file_n :List of 4 ..$ message : chr "Number of accepted model output files per round met. \n " ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" ..$ call : chr "check_file_n" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ metadata_exists :List of 4 + $ metadata_exists :List of 4 ..$ message : chr "Metadata file exists at path 'model-metadata/team1-goodmodel.yaml'. \n " ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" ..$ call : chr "check_submission_metadata_file_exists" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_read :List of 4 + $ file_read :List of 4 ..$ message : chr "File could be read successfully. \n " ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" ..$ call : chr "check_file_read" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ valid_round_id_col:List of 4 + $ valid_round_id_col :List of 4 ..$ message : chr "`round_id_col` name is valid. \n " ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" ..$ call : chr "check_valid_round_id_col" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ unique_round_id :List of 4 + $ unique_round_id :List of 4 ..$ message : chr "`round_id` column \"origin_date\" contains a single, unique round ID value. \n " ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" ..$ call : chr "check_tbl_unique_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ match_round_id :List of 4 + $ match_round_id :List of 4 ..$ message : chr "All `round_id_col` \"origin_date\" values match submission `round_id` from file name. \n " ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" ..$ call : chr "check_tbl_match_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ colnames :List of 4 + $ colnames :List of 4 ..$ message : chr "Column names are consistent with expected round task IDs and std column names. \n " ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" ..$ call : chr "check_tbl_colnames" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ col_types :List of 4 + $ col_types :List of 4 ..$ message : chr "Column data types match hub schema. \n " ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" ..$ call : chr "check_tbl_col_types" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ valid_vals :List of 5 + $ valid_vals :List of 5 ..$ message : chr "`tbl` contains valid values/value combinations. \n " ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" ..$ error_tbl : NULL ..$ call : chr "check_tbl_values" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ rows_unique :List of 4 + $ derived_task_id_vals:List of 4 + ..$ message : chr "No derived task IDs to check. Skipping derived task ID value check." + ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" + ..$ call : chr "check_tbl_derived_task_id_vals" + ..$ use_cli_format: logi TRUE + ..- attr(*, "class")= chr [1:5] "check_info" "hub_check" "rlang_message" "message" ... + $ rows_unique :List of 4 ..$ message : chr "All combinations of task ID column/`output_type`/`output_type_id` values are unique. \n " ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" ..$ call : chr "check_tbl_rows_unique" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ req_vals :List of 5 + $ req_vals :List of 5 ..$ message : chr "Required task ID/output type/output type ID combinations all present. \n " ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" ..$ missing : tibble [0 x 7] (S3: tbl_df/tbl/data.frame) @@ -2040,20 +2112,20 @@ ..$ call : chr "check_tbl_values_required" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_valid :List of 4 + $ value_col_valid :List of 4 ..$ message : chr "Values in column `value` all valid with respect to modeling task config. \n " ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" ..$ call : chr "check_tbl_value_col" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_non_desc:List of 5 + $ value_col_non_desc :List of 5 ..$ message : chr "Values in `value` column are non-decreasing as output_type_ids increase for all unique task ID\n value/outpu"| __truncated__ ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" ..$ error_tbl : NULL ..$ call : chr "check_tbl_value_col_ascending" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_sum1 :List of 4 + $ value_col_sum1 :List of 4 ..$ message : chr "No pmf output types to check for sum of 1. Check skipped." ..$ where : 'fs_path' chr "team1-goodmodel/2022-10-22-team1-goodmodel.csv" ..$ call : chr "check_tbl_value_col_sum1" diff --git a/tests/testthat/_snaps/validate_submission.md b/tests/testthat/_snaps/validate_submission.md index e97f59b9..e9e94253 100644 --- a/tests/testthat/_snaps/validate_submission.md +++ b/tests/testthat/_snaps/validate_submission.md @@ -4,99 +4,105 @@ str(validate_submission(hub_path, file_path = "team1-goodmodel/2022-10-08-team1-goodmodel.csv", skip_submit_window_check = TRUE, skip_check_config = TRUE)) Output - List of 19 - $ file_exists :List of 4 + List of 20 + $ file_exists :List of 4 ..$ message : chr "File exists at path 'model-output/team1-goodmodel/2022-10-08-team1-goodmodel.csv'. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_file_exists" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_name :List of 4 + $ file_name :List of 4 ..$ message : chr "File name \"2022-10-08-team1-goodmodel.csv\" is valid. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_file_name" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_location :List of 4 + $ file_location :List of 4 ..$ message : chr "File directory name matches `model_id`\n metadata in file name. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_file_location" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ round_id_valid :List of 4 + $ round_id_valid :List of 4 ..$ message : chr "`round_id` is valid. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_valid_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_format :List of 4 + $ file_format :List of 4 ..$ message : chr "File is accepted hub format. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_file_format" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_n :List of 4 + $ file_n :List of 4 ..$ message : chr "Number of accepted model output files per round met. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_file_n" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ metadata_exists :List of 4 + $ metadata_exists :List of 4 ..$ message : chr "Metadata file exists at path 'model-metadata/team1-goodmodel.yaml'. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_submission_metadata_file_exists" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_read :List of 4 + $ file_read :List of 4 ..$ message : chr "File could be read successfully. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_file_read" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ valid_round_id_col:List of 4 + $ valid_round_id_col :List of 4 ..$ message : chr "`round_id_col` name is valid. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_valid_round_id_col" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ unique_round_id :List of 4 + $ unique_round_id :List of 4 ..$ message : chr "`round_id` column \"origin_date\" contains a single, unique round ID value. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_unique_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ match_round_id :List of 4 + $ match_round_id :List of 4 ..$ message : chr "All `round_id_col` \"origin_date\" values match submission `round_id` from file name. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_match_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ colnames :List of 4 + $ colnames :List of 4 ..$ message : chr "Column names are consistent with expected round task IDs and std column names. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_colnames" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ col_types :List of 4 + $ col_types :List of 4 ..$ message : chr "Column data types match hub schema. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_col_types" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ valid_vals :List of 5 + $ valid_vals :List of 5 ..$ message : chr "`tbl` contains valid values/value combinations. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ error_tbl : NULL ..$ call : chr "check_tbl_values" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ rows_unique :List of 4 + $ derived_task_id_vals:List of 4 + ..$ message : chr "No derived task IDs to check. Skipping derived task ID value check." + ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" + ..$ call : chr "check_tbl_derived_task_id_vals" + ..$ use_cli_format: logi TRUE + ..- attr(*, "class")= chr [1:5] "check_info" "hub_check" "rlang_message" "message" ... + $ rows_unique :List of 4 ..$ message : chr "All combinations of task ID column/`output_type`/`output_type_id` values are unique. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_rows_unique" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ req_vals :List of 5 + $ req_vals :List of 5 ..$ message : chr "Required task ID/output type/output type ID combinations all present. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ missing : tibble [0 x 6] (S3: tbl_df/tbl/data.frame) @@ -109,20 +115,20 @@ ..$ call : chr "check_tbl_values_required" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_valid :List of 4 + $ value_col_valid :List of 4 ..$ message : chr "Values in column `value` all valid with respect to modeling task config. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_value_col" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_non_desc:List of 5 + $ value_col_non_desc :List of 5 ..$ message : chr "Values in `value` column are non-decreasing as output_type_ids increase for all unique task ID\n value/outpu"| __truncated__ ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ error_tbl : NULL ..$ call : chr "check_tbl_value_col_ascending" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_sum1 :List of 4 + $ value_col_sum1 :List of 4 ..$ message : chr "No pmf output types to check for sum of 1. Check skipped." ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_value_col_sum1" @@ -303,105 +309,111 @@ str(validate_submission(hub_path, file_path = "team1-goodmodel/2022-10-08-team1-goodmodel.csv", skip_submit_window_check = TRUE)) Output - List of 20 - $ valid_config :List of 4 + List of 21 + $ valid_config :List of 4 ..$ message : chr "All hub config files are valid. \n " ..$ where : chr "simple" ..$ call : chr "check_config_hub_valid" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_exists :List of 4 + $ file_exists :List of 4 ..$ message : chr "File exists at path 'model-output/team1-goodmodel/2022-10-08-team1-goodmodel.csv'. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_file_exists" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_name :List of 4 + $ file_name :List of 4 ..$ message : chr "File name \"2022-10-08-team1-goodmodel.csv\" is valid. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_file_name" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_location :List of 4 + $ file_location :List of 4 ..$ message : chr "File directory name matches `model_id`\n metadata in file name. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_file_location" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ round_id_valid :List of 4 + $ round_id_valid :List of 4 ..$ message : chr "`round_id` is valid. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_valid_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_format :List of 4 + $ file_format :List of 4 ..$ message : chr "File is accepted hub format. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_file_format" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_n :List of 4 + $ file_n :List of 4 ..$ message : chr "Number of accepted model output files per round met. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_file_n" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ metadata_exists :List of 4 + $ metadata_exists :List of 4 ..$ message : chr "Metadata file exists at path 'model-metadata/team1-goodmodel.yaml'. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_submission_metadata_file_exists" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_read :List of 4 + $ file_read :List of 4 ..$ message : chr "File could be read successfully. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_file_read" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ valid_round_id_col:List of 4 + $ valid_round_id_col :List of 4 ..$ message : chr "`round_id_col` name is valid. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_valid_round_id_col" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ unique_round_id :List of 4 + $ unique_round_id :List of 4 ..$ message : chr "`round_id` column \"origin_date\" contains a single, unique round ID value. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_unique_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ match_round_id :List of 4 + $ match_round_id :List of 4 ..$ message : chr "All `round_id_col` \"origin_date\" values match submission `round_id` from file name. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_match_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ colnames :List of 4 + $ colnames :List of 4 ..$ message : chr "Column names are consistent with expected round task IDs and std column names. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_colnames" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ col_types :List of 4 + $ col_types :List of 4 ..$ message : chr "Column data types match hub schema. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_col_types" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ valid_vals :List of 5 + $ valid_vals :List of 5 ..$ message : chr "`tbl` contains valid values/value combinations. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ error_tbl : NULL ..$ call : chr "check_tbl_values" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ rows_unique :List of 4 + $ derived_task_id_vals:List of 4 + ..$ message : chr "No derived task IDs to check. Skipping derived task ID value check." + ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" + ..$ call : chr "check_tbl_derived_task_id_vals" + ..$ use_cli_format: logi TRUE + ..- attr(*, "class")= chr [1:5] "check_info" "hub_check" "rlang_message" "message" ... + $ rows_unique :List of 4 ..$ message : chr "All combinations of task ID column/`output_type`/`output_type_id` values are unique. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_rows_unique" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ req_vals :List of 5 + $ req_vals :List of 5 ..$ message : chr "Required task ID/output type/output type ID combinations all present. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ missing : tibble [0 x 6] (S3: tbl_df/tbl/data.frame) @@ -414,20 +426,20 @@ ..$ call : chr "check_tbl_values_required" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_valid :List of 4 + $ value_col_valid :List of 4 ..$ message : chr "Values in column `value` all valid with respect to modeling task config. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_value_col" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_non_desc:List of 5 + $ value_col_non_desc :List of 5 ..$ message : chr "Values in `value` column are non-decreasing as output_type_ids increase for all unique task ID\n value/outpu"| __truncated__ ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ error_tbl : NULL ..$ call : chr "check_tbl_value_col_ascending" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_sum1 :List of 4 + $ value_col_sum1 :List of 4 ..$ message : chr "No pmf output types to check for sum of 1. Check skipped." ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_value_col_sum1" @@ -469,105 +481,111 @@ str(validate_submission(hub_path = test_path("testdata/hub"), file_path = "hub-baseline/2023-04-24-hub-baseline.csv", skip_submit_window_check = TRUE)) Output - List of 20 - $ valid_config :List of 4 + List of 21 + $ valid_config :List of 4 ..$ message : chr "All hub config files are valid. \n " ..$ where : chr "hub" ..$ call : chr "check_config_hub_valid" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_exists :List of 4 + $ file_exists :List of 4 ..$ message : chr "File exists at path 'forecasts/hub-baseline/2023-04-24-hub-baseline.csv'. \n " ..$ where : chr "hub-baseline/2023-04-24-hub-baseline.csv" ..$ call : chr "check_file_exists" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_name :List of 4 + $ file_name :List of 4 ..$ message : chr "File name \"2023-04-24-hub-baseline.csv\" is valid. \n " ..$ where : chr "hub-baseline/2023-04-24-hub-baseline.csv" ..$ call : chr "check_file_name" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_location :List of 4 + $ file_location :List of 4 ..$ message : chr "File directory name matches `model_id`\n metadata in file name. \n " ..$ where : chr "hub-baseline/2023-04-24-hub-baseline.csv" ..$ call : chr "check_file_location" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ round_id_valid :List of 4 + $ round_id_valid :List of 4 ..$ message : chr "`round_id` is valid. \n " ..$ where : chr "hub-baseline/2023-04-24-hub-baseline.csv" ..$ call : chr "check_valid_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_format :List of 4 + $ file_format :List of 4 ..$ message : chr "File is accepted hub format. \n " ..$ where : chr "hub-baseline/2023-04-24-hub-baseline.csv" ..$ call : chr "check_file_format" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_n :List of 4 + $ file_n :List of 4 ..$ message : chr "Number of accepted model output files per round met. \n " ..$ where : chr "hub-baseline/2023-04-24-hub-baseline.csv" ..$ call : chr "check_file_n" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ metadata_exists :List of 4 + $ metadata_exists :List of 4 ..$ message : chr "Metadata file exists at path 'model-metadata/hub-baseline.yml'. \n " ..$ where : chr "hub-baseline/2023-04-24-hub-baseline.csv" ..$ call : chr "check_submission_metadata_file_exists" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_read :List of 4 + $ file_read :List of 4 ..$ message : chr "File could be read successfully. \n " ..$ where : chr "hub-baseline/2023-04-24-hub-baseline.csv" ..$ call : chr "check_file_read" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ valid_round_id_col:List of 4 + $ valid_round_id_col :List of 4 ..$ message : chr "`round_id_col` name is valid. \n " ..$ where : chr "hub-baseline/2023-04-24-hub-baseline.csv" ..$ call : chr "check_valid_round_id_col" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ unique_round_id :List of 4 + $ unique_round_id :List of 4 ..$ message : chr "`round_id` column \"forecast_date\" contains a single, unique round ID value. \n " ..$ where : chr "hub-baseline/2023-04-24-hub-baseline.csv" ..$ call : chr "check_tbl_unique_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ match_round_id :List of 4 + $ match_round_id :List of 4 ..$ message : chr "All `round_id_col` \"forecast_date\" values match submission `round_id` from file name. \n " ..$ where : chr "hub-baseline/2023-04-24-hub-baseline.csv" ..$ call : chr "check_tbl_match_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ colnames :List of 4 + $ colnames :List of 4 ..$ message : chr "Column names are consistent with expected round task IDs and std column names. \n " ..$ where : chr "hub-baseline/2023-04-24-hub-baseline.csv" ..$ call : chr "check_tbl_colnames" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ col_types :List of 4 + $ col_types :List of 4 ..$ message : chr "Column data types match hub schema. \n " ..$ where : chr "hub-baseline/2023-04-24-hub-baseline.csv" ..$ call : chr "check_tbl_col_types" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ valid_vals :List of 5 + $ valid_vals :List of 5 ..$ message : chr "`tbl` contains valid values/value combinations. \n " ..$ where : chr "hub-baseline/2023-04-24-hub-baseline.csv" ..$ error_tbl : NULL ..$ call : chr "check_tbl_values" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ rows_unique :List of 4 + $ derived_task_id_vals:List of 4 + ..$ message : chr "No derived task IDs to check. Skipping derived task ID value check." + ..$ where : chr "hub-baseline/2023-04-24-hub-baseline.csv" + ..$ call : chr "check_tbl_derived_task_id_vals" + ..$ use_cli_format: logi TRUE + ..- attr(*, "class")= chr [1:5] "check_info" "hub_check" "rlang_message" "message" ... + $ rows_unique :List of 4 ..$ message : chr "All combinations of task ID column/`output_type`/`output_type_id` values are unique. \n " ..$ where : chr "hub-baseline/2023-04-24-hub-baseline.csv" ..$ call : chr "check_tbl_rows_unique" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ req_vals :List of 5 + $ req_vals :List of 5 ..$ message : chr "Required task ID/output type/output type ID combinations all present. \n " ..$ where : chr "hub-baseline/2023-04-24-hub-baseline.csv" ..$ missing : tibble [0 x 7] (S3: tbl_df/tbl/data.frame) @@ -581,20 +599,20 @@ ..$ call : chr "check_tbl_values_required" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_valid :List of 4 + $ value_col_valid :List of 4 ..$ message : chr "Values in column `value` all valid with respect to modeling task config. \n " ..$ where : chr "hub-baseline/2023-04-24-hub-baseline.csv" ..$ call : chr "check_tbl_value_col" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_non_desc:List of 5 + $ value_col_non_desc :List of 5 ..$ message : chr "Values in `value` column are non-decreasing as output_type_ids increase for all unique task ID\n value/outpu"| __truncated__ ..$ where : chr "hub-baseline/2023-04-24-hub-baseline.csv" ..$ error_tbl : NULL ..$ call : chr "check_tbl_value_col_ascending" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_sum1 :List of 4 + $ value_col_sum1 :List of 4 ..$ message : chr "No pmf output types to check for sum of 1. Check skipped." ..$ where : chr "hub-baseline/2023-04-24-hub-baseline.csv" ..$ call : chr "check_tbl_value_col_sum1" @@ -608,105 +626,111 @@ str(validate_submission(hub_path = test_path("testdata/hub-nul"), file_path = "team-model/2023-11-26-team-model.parquet", skip_submit_window_check = TRUE)) Output - List of 20 - $ valid_config :List of 4 + List of 21 + $ valid_config :List of 4 ..$ message : chr "All hub config files are valid. \n " ..$ where : chr "hub-nul" ..$ call : chr "check_config_hub_valid" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_exists :List of 4 + $ file_exists :List of 4 ..$ message : chr "File exists at path 'model-output/team-model/2023-11-26-team-model.parquet'. \n " ..$ where : chr "team-model/2023-11-26-team-model.parquet" ..$ call : chr "check_file_exists" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_name :List of 4 + $ file_name :List of 4 ..$ message : chr "File name \"2023-11-26-team-model.parquet\" is valid. \n " ..$ where : chr "team-model/2023-11-26-team-model.parquet" ..$ call : chr "check_file_name" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_location :List of 4 + $ file_location :List of 4 ..$ message : chr "File directory name matches `model_id`\n metadata in file name. \n " ..$ where : chr "team-model/2023-11-26-team-model.parquet" ..$ call : chr "check_file_location" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ round_id_valid :List of 4 + $ round_id_valid :List of 4 ..$ message : chr "`round_id` is valid. \n " ..$ where : chr "team-model/2023-11-26-team-model.parquet" ..$ call : chr "check_valid_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_format :List of 4 + $ file_format :List of 4 ..$ message : chr "File is accepted hub format. \n " ..$ where : chr "team-model/2023-11-26-team-model.parquet" ..$ call : chr "check_file_format" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_n :List of 4 + $ file_n :List of 4 ..$ message : chr "Number of accepted model output files per round met. \n " ..$ where : chr "team-model/2023-11-26-team-model.parquet" ..$ call : chr "check_file_n" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ metadata_exists :List of 4 + $ metadata_exists :List of 4 ..$ message : chr "Metadata file exists at path 'model-metadata/team-model.yaml'. \n " ..$ where : chr "team-model/2023-11-26-team-model.parquet" ..$ call : chr "check_submission_metadata_file_exists" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_read :List of 4 + $ file_read :List of 4 ..$ message : chr "File could be read successfully. \n " ..$ where : chr "team-model/2023-11-26-team-model.parquet" ..$ call : chr "check_file_read" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ valid_round_id_col:List of 4 + $ valid_round_id_col :List of 4 ..$ message : chr "`round_id_col` name is valid. \n " ..$ where : chr "team-model/2023-11-26-team-model.parquet" ..$ call : chr "check_valid_round_id_col" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ unique_round_id :List of 4 + $ unique_round_id :List of 4 ..$ message : chr "`round_id` column \"origin_date\" contains a single, unique round ID value. \n " ..$ where : chr "team-model/2023-11-26-team-model.parquet" ..$ call : chr "check_tbl_unique_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ match_round_id :List of 4 + $ match_round_id :List of 4 ..$ message : chr "All `round_id_col` \"origin_date\" values match submission `round_id` from file name. \n " ..$ where : chr "team-model/2023-11-26-team-model.parquet" ..$ call : chr "check_tbl_match_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ colnames :List of 4 + $ colnames :List of 4 ..$ message : chr "Column names are consistent with expected round task IDs and std column names. \n " ..$ where : chr "team-model/2023-11-26-team-model.parquet" ..$ call : chr "check_tbl_colnames" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ col_types :List of 4 + $ col_types :List of 4 ..$ message : chr "Column data types match hub schema. \n " ..$ where : chr "team-model/2023-11-26-team-model.parquet" ..$ call : chr "check_tbl_col_types" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ valid_vals :List of 5 + $ valid_vals :List of 5 ..$ message : chr "`tbl` contains valid values/value combinations. \n " ..$ where : chr "team-model/2023-11-26-team-model.parquet" ..$ error_tbl : NULL ..$ call : chr "check_tbl_values" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ rows_unique :List of 4 + $ derived_task_id_vals:List of 4 + ..$ message : chr "No derived task IDs to check. Skipping derived task ID value check." + ..$ where : chr "team-model/2023-11-26-team-model.parquet" + ..$ call : chr "check_tbl_derived_task_id_vals" + ..$ use_cli_format: logi TRUE + ..- attr(*, "class")= chr [1:5] "check_info" "hub_check" "rlang_message" "message" ... + $ rows_unique :List of 4 ..$ message : chr "All combinations of task ID column/`output_type`/`output_type_id` values are unique. \n " ..$ where : chr "team-model/2023-11-26-team-model.parquet" ..$ call : chr "check_tbl_rows_unique" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ req_vals :List of 5 + $ req_vals :List of 5 ..$ message : chr "Required task ID/output type/output type ID combinations all present. \n " ..$ where : chr "team-model/2023-11-26-team-model.parquet" ..$ missing : tibble [0 x 7] (S3: tbl_df/tbl/data.frame) @@ -720,20 +744,20 @@ ..$ call : chr "check_tbl_values_required" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_valid :List of 4 + $ value_col_valid :List of 4 ..$ message : chr "Values in column `value` all valid with respect to modeling task config. \n " ..$ where : chr "team-model/2023-11-26-team-model.parquet" ..$ call : chr "check_tbl_value_col" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_non_desc:List of 5 + $ value_col_non_desc :List of 5 ..$ message : chr "Values in `value` column are non-decreasing as output_type_ids increase for all unique task ID\n value/outpu"| __truncated__ ..$ where : chr "team-model/2023-11-26-team-model.parquet" ..$ error_tbl : NULL ..$ call : chr "check_tbl_value_col_ascending" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_sum1 :List of 4 + $ value_col_sum1 :List of 4 ..$ message : chr "No pmf output types to check for sum of 1. Check skipped." ..$ where : chr "team-model/2023-11-26-team-model.parquet" ..$ call : chr "check_tbl_value_col_sum1" @@ -747,105 +771,111 @@ str(validate_submission(hub_path = test_path("testdata/hub-nul"), file_path = "team-model/2023-11-19-team-model.parquet", skip_submit_window_check = TRUE)) Output - List of 20 - $ valid_config :List of 4 + List of 21 + $ valid_config :List of 4 ..$ message : chr "All hub config files are valid. \n " ..$ where : chr "hub-nul" ..$ call : chr "check_config_hub_valid" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_exists :List of 4 + $ file_exists :List of 4 ..$ message : chr "File exists at path 'model-output/team-model/2023-11-19-team-model.parquet'. \n " ..$ where : chr "team-model/2023-11-19-team-model.parquet" ..$ call : chr "check_file_exists" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_name :List of 4 + $ file_name :List of 4 ..$ message : chr "File name \"2023-11-19-team-model.parquet\" is valid. \n " ..$ where : chr "team-model/2023-11-19-team-model.parquet" ..$ call : chr "check_file_name" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_location :List of 4 + $ file_location :List of 4 ..$ message : chr "File directory name matches `model_id`\n metadata in file name. \n " ..$ where : chr "team-model/2023-11-19-team-model.parquet" ..$ call : chr "check_file_location" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ round_id_valid :List of 4 + $ round_id_valid :List of 4 ..$ message : chr "`round_id` is valid. \n " ..$ where : chr "team-model/2023-11-19-team-model.parquet" ..$ call : chr "check_valid_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_format :List of 4 + $ file_format :List of 4 ..$ message : chr "File is accepted hub format. \n " ..$ where : chr "team-model/2023-11-19-team-model.parquet" ..$ call : chr "check_file_format" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_n :List of 4 + $ file_n :List of 4 ..$ message : chr "Number of accepted model output files per round met. \n " ..$ where : chr "team-model/2023-11-19-team-model.parquet" ..$ call : chr "check_file_n" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ metadata_exists :List of 4 + $ metadata_exists :List of 4 ..$ message : chr "Metadata file exists at path 'model-metadata/team-model.yaml'. \n " ..$ where : chr "team-model/2023-11-19-team-model.parquet" ..$ call : chr "check_submission_metadata_file_exists" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_read :List of 4 + $ file_read :List of 4 ..$ message : chr "File could be read successfully. \n " ..$ where : chr "team-model/2023-11-19-team-model.parquet" ..$ call : chr "check_file_read" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ valid_round_id_col:List of 4 + $ valid_round_id_col :List of 4 ..$ message : chr "`round_id_col` name is valid. \n " ..$ where : chr "team-model/2023-11-19-team-model.parquet" ..$ call : chr "check_valid_round_id_col" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ unique_round_id :List of 4 + $ unique_round_id :List of 4 ..$ message : chr "`round_id` column \"origin_date\" contains a single, unique round ID value. \n " ..$ where : chr "team-model/2023-11-19-team-model.parquet" ..$ call : chr "check_tbl_unique_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ match_round_id :List of 4 + $ match_round_id :List of 4 ..$ message : chr "All `round_id_col` \"origin_date\" values match submission `round_id` from file name. \n " ..$ where : chr "team-model/2023-11-19-team-model.parquet" ..$ call : chr "check_tbl_match_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ colnames :List of 4 + $ colnames :List of 4 ..$ message : chr "Column names are consistent with expected round task IDs and std column names. \n " ..$ where : chr "team-model/2023-11-19-team-model.parquet" ..$ call : chr "check_tbl_colnames" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ col_types :List of 4 + $ col_types :List of 4 ..$ message : chr "Column data types match hub schema. \n " ..$ where : chr "team-model/2023-11-19-team-model.parquet" ..$ call : chr "check_tbl_col_types" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ valid_vals :List of 5 + $ valid_vals :List of 5 ..$ message : chr "`tbl` contains valid values/value combinations. \n " ..$ where : chr "team-model/2023-11-19-team-model.parquet" ..$ error_tbl : NULL ..$ call : chr "check_tbl_values" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ rows_unique :List of 4 + $ derived_task_id_vals:List of 4 + ..$ message : chr "No derived task IDs to check. Skipping derived task ID value check." + ..$ where : chr "team-model/2023-11-19-team-model.parquet" + ..$ call : chr "check_tbl_derived_task_id_vals" + ..$ use_cli_format: logi TRUE + ..- attr(*, "class")= chr [1:5] "check_info" "hub_check" "rlang_message" "message" ... + $ rows_unique :List of 4 ..$ message : chr "All combinations of task ID column/`output_type`/`output_type_id` values are unique. \n " ..$ where : chr "team-model/2023-11-19-team-model.parquet" ..$ call : chr "check_tbl_rows_unique" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ req_vals :List of 5 + $ req_vals :List of 5 ..$ message : chr "Required task ID/output type/output type ID combinations all present. \n " ..$ where : chr "team-model/2023-11-19-team-model.parquet" ..$ missing : tibble [0 x 7] (S3: tbl_df/tbl/data.frame) @@ -859,20 +889,20 @@ ..$ call : chr "check_tbl_values_required" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_valid :List of 4 + $ value_col_valid :List of 4 ..$ message : chr "Values in column `value` all valid with respect to modeling task config. \n " ..$ where : chr "team-model/2023-11-19-team-model.parquet" ..$ call : chr "check_tbl_value_col" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_non_desc:List of 5 + $ value_col_non_desc :List of 5 ..$ message : chr "Values in `value` column are non-decreasing as output_type_ids increase for all unique task ID\n value/outpu"| __truncated__ ..$ where : chr "team-model/2023-11-19-team-model.parquet" ..$ error_tbl : NULL ..$ call : chr "check_tbl_value_col_ascending" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_sum1 :List of 4 + $ value_col_sum1 :List of 4 ..$ message : chr "No pmf output types to check for sum of 1. Check skipped." ..$ where : chr "team-model/2023-11-19-team-model.parquet" ..$ call : chr "check_tbl_value_col_sum1" @@ -999,7 +1029,7 @@ file_path = "flu-base/2022-10-22-flu-base.csv", skip_submit_window_check = TRUE, derived_task_ids = "target_end_date")) Output - List of 25 + List of 26 $ valid_config :List of 4 ..$ message : chr "All hub config files are valid. \n " ..$ where : chr "samples" @@ -1091,6 +1121,13 @@ ..$ call : chr "check_tbl_values" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... + $ derived_task_id_vals :List of 5 + ..$ message : chr "`tbl` contains valid derived task ID values. \n " + ..$ where : chr "flu-base/2022-10-22-flu-base.csv" + ..$ errors : NULL + ..$ call : chr "check_tbl_derived_task_id_vals" + ..$ use_cli_format: logi TRUE + ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... $ rows_unique :List of 4 ..$ message : chr "All combinations of task ID column/`output_type`/`output_type_id` values are unique. \n " ..$ where : chr "flu-base/2022-10-22-flu-base.csv" @@ -1219,38 +1256,38 @@ Code str(dup_model_out_val) Output - List of 19 - $ file_exists :List of 4 + List of 20 + $ file_exists :List of 4 ..$ message : chr "File exists at path 'model-output/team1-goodmodel/2022-10-08-team1-goodmodel.csv'. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_file_exists" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_name :List of 4 + $ file_name :List of 4 ..$ message : chr "File name \"2022-10-08-team1-goodmodel.csv\" is valid. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_file_name" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_location :List of 4 + $ file_location :List of 4 ..$ message : chr "File directory name matches `model_id`\n metadata in file name. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_file_location" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ round_id_valid :List of 4 + $ round_id_valid :List of 4 ..$ message : chr "`round_id` is valid. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_valid_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_format :List of 4 + $ file_format :List of 4 ..$ message : chr "File is accepted hub format. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_file_format" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_n :List of 6 + $ file_n :List of 6 ..$ message : chr "Number of accepted model output files per round exceeded. \n Should be 1 but pre-existing round\n submissi"| __truncated__ ..$ trace : NULL ..$ parent : NULL @@ -1258,62 +1295,68 @@ ..$ call : chr "check_file_n" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_failure" "hub_check" "rlang_error" "error" ... - $ metadata_exists :List of 4 + $ metadata_exists :List of 4 ..$ message : chr "Metadata file exists at path 'model-metadata/team1-goodmodel.yaml'. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_submission_metadata_file_exists" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ file_read :List of 4 + $ file_read :List of 4 ..$ message : chr "File could be read successfully. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_file_read" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ valid_round_id_col:List of 4 + $ valid_round_id_col :List of 4 ..$ message : chr "`round_id_col` name is valid. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_valid_round_id_col" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ unique_round_id :List of 4 + $ unique_round_id :List of 4 ..$ message : chr "`round_id` column \"origin_date\" contains a single, unique round ID value. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_unique_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ match_round_id :List of 4 + $ match_round_id :List of 4 ..$ message : chr "All `round_id_col` \"origin_date\" values match submission `round_id` from file name. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_match_round_id" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ colnames :List of 4 + $ colnames :List of 4 ..$ message : chr "Column names are consistent with expected round task IDs and std column names. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_colnames" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ col_types :List of 4 + $ col_types :List of 4 ..$ message : chr "Column data types match hub schema. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_col_types" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ valid_vals :List of 5 + $ valid_vals :List of 5 ..$ message : chr "`tbl` contains valid values/value combinations. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ error_tbl : NULL ..$ call : chr "check_tbl_values" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ rows_unique :List of 4 + $ derived_task_id_vals:List of 4 + ..$ message : chr "No derived task IDs to check. Skipping derived task ID value check." + ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" + ..$ call : chr "check_tbl_derived_task_id_vals" + ..$ use_cli_format: logi TRUE + ..- attr(*, "class")= chr [1:5] "check_info" "hub_check" "rlang_message" "message" ... + $ rows_unique :List of 4 ..$ message : chr "All combinations of task ID column/`output_type`/`output_type_id` values are unique. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_rows_unique" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ req_vals :List of 5 + $ req_vals :List of 5 ..$ message : chr "Required task ID/output type/output type ID combinations all present. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ missing : tibble [0 x 6] (S3: tbl_df/tbl/data.frame) @@ -1326,20 +1369,20 @@ ..$ call : chr "check_tbl_values_required" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_valid :List of 4 + $ value_col_valid :List of 4 ..$ message : chr "Values in column `value` all valid with respect to modeling task config. \n " ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_value_col" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_non_desc:List of 5 + $ value_col_non_desc :List of 5 ..$ message : chr "Values in `value` column are non-decreasing as output_type_ids increase for all unique task ID\n value/outpu"| __truncated__ ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ error_tbl : NULL ..$ call : chr "check_tbl_value_col_ascending" ..$ use_cli_format: logi TRUE ..- attr(*, "class")= chr [1:5] "check_success" "hub_check" "rlang_message" "message" ... - $ value_col_sum1 :List of 4 + $ value_col_sum1 :List of 4 ..$ message : chr "No pmf output types to check for sum of 1. Check skipped." ..$ where : chr "team1-goodmodel/2022-10-08-team1-goodmodel.csv" ..$ call : chr "check_tbl_value_col_sum1" diff --git a/tests/testthat/test-check_tbl_derived_task_id_vals.R b/tests/testthat/test-check_tbl_derived_task_id_vals.R new file mode 100644 index 00000000..93b52f32 --- /dev/null +++ b/tests/testthat/test-check_tbl_derived_task_id_vals.R @@ -0,0 +1,28 @@ +test_that("check_tbl_derived_task_ids_vals works", { + hub_path <- system.file("testhubs/v4/flusight", package = "hubUtils") + file_path <- "hub-baseline/2023-05-08-hub-baseline.parquet" + round_id <- "2023-05-08" + tbl <- read_model_out_file(file_path, hub_path, coerce_types = "chr") + + # Check should succeed + expect_snapshot( + check_tbl_derived_task_id_vals( + tbl, round_id, file_path, hub_path + ) + ) + # Check should skip + expect_snapshot( + check_tbl_derived_task_id_vals( + tbl, round_id, file_path, hub_path, + derived_task_ids = NULL + ) + ) + + tbl$target_date <- "random_val" + # Check should fail + expect_snapshot( + check_tbl_derived_task_id_vals( + tbl, round_id, file_path, hub_path + ) + ) +}) diff --git a/tests/testthat/test-validate_submission.R b/tests/testthat/test-validate_submission.R index 66dc94d6..6eba62f2 100644 --- a/tests/testthat/test-validate_submission.R +++ b/tests/testthat/test-validate_submission.R @@ -327,20 +327,6 @@ test_that("Ignoring derived_task_ids in validate_submission works", { ) ) ) - # Results of validation the same - expect_equal( - validate_submission( - hub_path = system.file("testhubs/samples", package = "hubValidations"), - file_path = "flu-base/2022-10-22-flu-base.csv", - skip_submit_window_check = TRUE, - derived_task_ids = "target_end_date" - ), - validate_submission( - hub_path = system.file("testhubs/samples", package = "hubValidations"), - file_path = "flu-base/2022-10-22-flu-base.csv", - skip_submit_window_check = TRUE - ) - ) # Ensure derived_task_ids values are ignored in validate submission by introducing # deliberate error in derived_task_ids through mocking.
valid_vals Columns (excluding `value` column) contain valid combinations of task ID / output type / output type ID values Columns (excluding the `value` and any derived task ID columns) contain valid combinations of task ID / output type / output type ID values TRUE check_error error_tbl: table of invalid task ID/output type/output type ID value combinations
derived_task_id_vals Derived task ID columns contain valid values. FALSE check_failure errors: named list of derived task ID values. Each element contains the invalid values for each derived task ID that failed the check.
rows_unique Columns (excluding `value` column) contain unique combinations of task ID / output type / output type ID values Columns (excluding the `value` and any derived task ID columns) contain unique combinations of task ID / output type / output type ID values FALSE check_failure
req_vals Columns (excluding `value` column) contain all required combinations of task ID / output type / output type ID values Columns (excluding the `value` and any derived task ID columns) contain all required combinations of task ID / output type / output type ID values FALSE check_failure missing_df: table of missing task ID/output type/output type ID value combinations
valid_vals Columns (excluding `value` column) contain valid combinations of task ID / output type / output type ID values Columns (excluding the `value` and any derived task ID columns) contain valid combinations of task ID / output type / output type ID values TRUE check_error error_tbl: table of invalid task ID/output type/output type ID value combinations
derived_task_id_vals Derived task ID columns contain valid values. FALSE check_failure errors: named list of derived task ID values. Each element contains the invalid values for each derived task ID that failed the check.
rows_unique Columns (excluding `value` column) contain unique combinations of task ID / output type / output type ID values Columns (excluding the `value` and any derived task ID columns) contain unique combinations of task ID / output type / output type ID values FALSE check_failure
req_vals Columns (excluding `value` column) contain all required combinations of task ID / output type / output type ID values Columns (excluding the `value` and any derived task ID columns) contain all required combinations of task ID / output type / output type ID values FALSE check_failure missing_df: table of missing task ID/output type/output type ID value combinations