Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename get_derived_task_ids to get_hub_derived_task_ids. Resolves #169 #170

Merged
merged 1 commit into from
Nov 22, 2024
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: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ importFrom(dplyr,"%>%")
importFrom(hubAdmin,validate_hub_config)
importFrom(hubData,coerce_to_hub_schema)
importFrom(hubData,create_hub_schema)
importFrom(hubUtils,get_derived_task_ids)
importFrom(hubUtils,get_hub_derived_task_ids)
importFrom(hubUtils,get_hub_file_formats)
importFrom(hubUtils,get_hub_model_output_dir)
importFrom(hubUtils,get_hub_timezone)
Expand Down
4 changes: 2 additions & 2 deletions R/check_tbl_spl_compound_taskid_set.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#' @param 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 `NA`s. Defaults to extracting derived task IDs from hub `task.json`. See
#' [get_derived_task_ids()] for more details.
#' [get_hub_derived_task_ids()] for more details.
#' @inheritParams expand_model_out_grid
#' @details If the check fails, the output of the check includes an `errors` element,
#' a list of items, one for each modeling task failing validation.
Expand All @@ -38,7 +38,7 @@
#' @export
check_tbl_spl_compound_taskid_set <- function(
tbl, round_id, file_path, hub_path,
derived_task_ids = get_derived_task_ids(hub_path)) {
derived_task_ids = get_hub_derived_task_ids(hub_path)) {
config_tasks <- read_config(hub_path, "tasks")

if (isFALSE(has_spls_tbl(tbl)) || isFALSE(hubUtils::is_v3_config(config_tasks))) {
Expand Down
2 changes: 1 addition & 1 deletion R/check_tbl_spl_compound_tid.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
#' @export
check_tbl_spl_compound_tid <- function(tbl, round_id, file_path, hub_path,
compound_taskid_set = NULL,
derived_task_ids = get_derived_task_ids(hub_path, round_id)) {
derived_task_ids = get_hub_derived_task_ids(hub_path, round_id)) {
if (!is.null(compound_taskid_set) && isTRUE(is.na(compound_taskid_set))) {
cli::cli_abort("Valid {.var compound_taskid_set} must be provided.")
}
Expand Down
2 changes: 1 addition & 1 deletion R/check_tbl_spl_n.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#' @export
check_tbl_spl_n <- function(tbl, round_id, file_path, hub_path,
compound_taskid_set = NULL,
derived_task_ids = get_derived_task_ids(hub_path, round_id)) {
derived_task_ids = get_hub_derived_task_ids(hub_path, round_id)) {
if (!is.null(compound_taskid_set) && isTRUE(is.na(compound_taskid_set))) {
cli::cli_abort("Valid {.var compound_taskid_set} must be provided.")
}
Expand Down
2 changes: 1 addition & 1 deletion R/check_tbl_spl_non_compound_tid.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#' @export
check_tbl_spl_non_compound_tid <- function(tbl, round_id, file_path, hub_path,
compound_taskid_set = NULL,
derived_task_ids = get_derived_task_ids(hub_path, round_id)) {
derived_task_ids = get_hub_derived_task_ids(hub_path, round_id)) {
if (!is.null(compound_taskid_set) && isTRUE(is.na(compound_taskid_set))) {
cli::cli_abort("Valid {.var compound_taskid_set} must be provided.")
}
Expand Down
2 changes: 1 addition & 1 deletion R/check_tbl_value_col.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#' @inheritParams expand_model_out_grid
#' @export
check_tbl_value_col <- function(tbl, round_id, file_path, hub_path,
derived_task_ids = get_derived_task_ids(hub_path, round_id)) {
derived_task_ids = get_hub_derived_task_ids(hub_path, round_id)) {
config_tasks <- read_config(hub_path, "tasks")

tbl[, names(tbl) != "value"] <- hubData::coerce_to_character(
Expand Down
2 changes: 1 addition & 1 deletion R/check_tbl_values.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#' @inherit check_tbl_colnames return
#' @export
check_tbl_values <- function(tbl, round_id, file_path, hub_path,
derived_task_ids = get_derived_task_ids(hub_path, round_id)) {
derived_task_ids = get_hub_derived_task_ids(hub_path, round_id)) {
config_tasks <- read_config(hub_path, "tasks")

valid_tbl <- tbl %>%
Expand Down
2 changes: 1 addition & 1 deletion R/check_tbl_values_required.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#' task ID values will result in **false validation errors when validating
#' required values**.
check_tbl_values_required <- function(tbl, round_id, file_path, hub_path,
derived_task_ids = get_derived_task_ids(hub_path)) {
derived_task_ids = get_hub_derived_task_ids(hub_path)) {
tbl[["value"]] <- NULL
config_tasks <- read_config(hub_path, "tasks")

Expand Down
2 changes: 1 addition & 1 deletion R/imports-hubUtils.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ NULL
#' @importFrom hubUtils get_hub_model_output_dir
NULL

#' @importFrom hubUtils get_derived_task_ids
#' @importFrom hubUtils get_hub_derived_task_ids
NULL
4 changes: 2 additions & 2 deletions R/validate_model_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' values depend on other task IDs) to ignore. Columns for such task ids will
#' contain `NA`s.
#' If `NULL`, defaults to extracting derived task IDs from hub `task.json`. See
#' [get_derived_task_ids()] for more details.
#' [get_hub_derived_task_ids()] for more details.
#' @inheritParams check_tbl_unique_round_id
#' @inheritParams validate_model_file
#' @inheritParams hubData::create_hub_schema
Expand Down Expand Up @@ -118,7 +118,7 @@ validate_model_data <- function(hub_path, file_path, round_id_col = NULL,

# Get derived task IDs if not specified
if (is.null(derived_task_ids)) {
derived_task_ids <- get_derived_task_ids(
derived_task_ids <- get_hub_derived_task_ids(
hub_path, round_id
)
} else {
Expand Down
4 changes: 2 additions & 2 deletions man/check_tbl_spl_compound_taskid_set.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/check_tbl_spl_compound_tid.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/check_tbl_spl_n.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/check_tbl_spl_non_compound_tid.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/check_tbl_value_col.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/check_tbl_values.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/check_tbl_values_required.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/validate_model_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/validate_pr.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/validate_submission.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tests/testthat/_snaps/expand_model_out_grid.md
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@

Code
suppressWarnings(expand_model_out_grid(config_tasks = config_tasks, round_id = round_id,
output_types = "pmf", derived_task_ids = get_derived_task_ids(hub_path)))
output_types = "pmf", derived_task_ids = get_hub_derived_task_ids(hub_path)))
Output
# A tibble: 540 x 7
forecast_date target horizon target_date location output_type output_type_id
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-expand_model_out_grid.R
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ test_that("v4 required output type ID values extracted correctly", {
config_tasks = config_tasks,
round_id = round_id,
output_types = "pmf",
derived_task_ids = get_derived_task_ids(hub_path)
derived_task_ids = get_hub_derived_task_ids(hub_path)
)
)
)
Expand Down