Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
annakrystalli committed Dec 17, 2024
1 parent c1baad6 commit 551de6f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions R/create_round.R
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,14 @@ check_round_id_pattern_vals <- function(model_tasks, round_id,
if (length(unlist(invalid_round_id_vals)) > 0L) {
invalid_vals_bullets <-
purrr::compact(invalid_round_id_vals) |>
# iterate over any model tasks containing invalid values
purrr::imap(~ {
mt_idx <- .y
# iterate over invalid values in "required" and "optional" properties if present
purrr::imap_chr(
.x,
~ {
# Create a separate message for invalid values in each model task and property
cli::format_inline("In {.arg model_tasks[[{mt_idx}]]${round_id}${.y}}: {.val {.x}}")
}
)
Expand Down
2 changes: 2 additions & 0 deletions R/validate-config-utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,8 @@ validate_mt_round_id_pattern <- function(model_task_grp,
glue::glue(
get_error_path(schema, "/task_ids", "instance")
),
# using names(invalid_vals_msg) creates a row for each property
# ("required"/"optional") containing invalid round_id values
round_id_var, names(invalid_vals_msg),
sep = "/"
),
Expand Down

0 comments on commit 551de6f

Please sign in to comment.