Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

- fix bug in `check_df_values_required()` dealing with model task containing
multiple output types.
- minor fixes: read partition of one file, improve output error message
of invalid or missing variables combination.

# SMHvalidation 1.1.0

Expand Down
1 change: 1 addition & 0 deletions R/imports-hubValidations.R
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ check_tbl_values <- function(tbl, round_id, file_path, hub_path) {
if (check) {
details <- NULL
} else {
valid_tbl <- dplyr::filter(valid_tbl, is.na(.data[["valid"]]))
valid_tbl <- tibble::rowid_to_column(valid_tbl)
error_summary <- summarise_invalid_values(valid_tbl, config_tasks, round_id)
details <- error_summary$msg
Expand Down
4 changes: 2 additions & 2 deletions R/plot_utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ print_table <- function(data, tab_title, metric = "prctdiff_gt", #"median",
dplyr::select(tidyr::all_of(c("scenario_id", "state", "outcome",
"ground truth")),
value = tidyr::all_of(metric)) |>
tidyr::pivot_wider(names_from = .data[["scenario_id"]],
values_from = .data[["value"]])
tidyr::pivot_wider(names_from = dplyr::matches("scenario_id"),
values_from = dplyr::matches("value"))

# Cells to highlight
nas <- na_cells(tab_data, sel_group)
Expand Down
2 changes: 1 addition & 1 deletion R/test_req_value.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ check_df_values_required <- function(test_df, model_task, file_path) {
req_targ <- NULL
} else {
req_targ <- purrr::map(x$task_ids, "required")
opt_targ <- purrr::map(x$task_ids, "optional")
opt_targ <- purrr::map(x$task_ids, unlist)
}
outtype_df <- extract_output_type(x)

Expand Down
2 changes: 1 addition & 1 deletion R/validate_submission.R
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ validate_submission <- function(path, hub_path, js_def = NULL,
return(check)
} else {
# Read file
if (length(file_path) == 1) {
if (length(file_path) == 1 && is.null(partition)) {
df <- read_files(paste0(hub_path, "/", path))
} else if (!is.null(partition)) {
schema <- make_schema(js_def0, js_def, round_id,
Expand Down
2 changes: 2 additions & 0 deletions tests/testthat/test_visualization.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ test_that("Test visualization", {
"target")))

df <- dplyr::filter(df0, .data[["output_type"]] == "sample")
if (!dir.exists(basename(path_f)))
dir.create(basename(path_f), recursive = TRUE)
arrow::write_parquet(df, path_f)
rm(df)

Expand Down
Loading