From ae484ebb293332c8d9115c576eab03726ff1a4c6 Mon Sep 17 00:00:00 2001 From: Nate McIntosh Date: Thu, 5 Dec 2024 16:08:43 -0500 Subject: [PATCH] realized that production_date is the wrong spot It was originally put there by copilot, and somehow I missed that it was there the whole time. This should have happened in the Config class PR. Not sure how it got through there. --- R/config.R | 8 +++++--- man/Config.Rd | 4 ++++ man/Data.Rd | 5 +---- tests/testthat/data/sample_config_no_exclusion.json | 1 + tests/testthat/data/sample_config_with_exclusion.json | 1 + tests/testthat/test-pipeline.R | 6 +++++- 6 files changed, 17 insertions(+), 8 deletions(-) diff --git a/R/config.R b/R/config.R index 512ec67..16bd4d5 100644 --- a/R/config.R +++ b/R/config.R @@ -93,7 +93,7 @@ Parameters <- S7::new_class( # nolint: object_name_linter #' occur. #' @param report_date A list of strings representing report dates. #' @param reference_date A list of strings representing reference dates. -#' @param production_date A list of strings representing production dates. + #' @export Data <- S7::new_class( # nolint: object_name_linter "Data", @@ -101,8 +101,7 @@ Data <- S7::new_class( # nolint: object_name_linter path = S7::class_character, blob_storage_container = character_or_null, report_date = S7::class_character, - reference_date = S7::class_character, - production_date = S7::class_character + reference_date = S7::class_character ) ) @@ -116,6 +115,8 @@ Data <- S7::new_class( # nolint: object_name_linter #' date. Formatted as "YYYY-MM-DD". #' @param max_reference_date A string representing the maximum reference #' date. Formatted as "YYYY-MM-DD". +#' @param production_date A string representing the production date. +#' Formatted as "YYYY-MM-DD". #' @param disease A string specifying the disease being modeled. #' @param geo_value A string specifying the geographic value, usually a state. #' @param geo_type A string specifying the geographic type, usually "state". @@ -146,6 +147,7 @@ Config <- S7::new_class( # nolint: object_name_linter min_reference_date = S7::class_character, max_reference_date = S7::class_character, report_date = S7::class_character, + production_date = S7::class_character, disease = S7::class_character, geo_value = S7::class_character, geo_type = S7::class_character, diff --git a/man/Config.Rd b/man/Config.Rd index 74dfb18..d2141e1 100644 --- a/man/Config.Rd +++ b/man/Config.Rd @@ -10,6 +10,7 @@ Config( min_reference_date = character(0), max_reference_date = character(0), report_date = character(0), + production_date = character(0), disease = character(0), geo_value = character(0), geo_type = character(0), @@ -39,6 +40,9 @@ date. Formatted as "YYYY-MM-DD".} \item{report_date}{A string representing the report date. Formatted as "YYYY-MM-DD".} +\item{production_date}{A string representing the production date. +Formatted as "YYYY-MM-DD".} + \item{disease}{A string specifying the disease being modeled.} \item{geo_value}{A string specifying the geographic value, usually a state.} diff --git a/man/Data.Rd b/man/Data.Rd index 095c246..b50069d 100644 --- a/man/Data.Rd +++ b/man/Data.Rd @@ -8,8 +8,7 @@ Data( path = character(0), blob_storage_container = character(0), report_date = character(0), - reference_date = character(0), - production_date = character(0) + reference_date = character(0) ) } \arguments{ @@ -22,8 +21,6 @@ occur.} \item{report_date}{A list of strings representing report dates.} \item{reference_date}{A list of strings representing reference dates.} - -\item{production_date}{A list of strings representing production dates.} } \description{ Represents the data-related configurations. diff --git a/tests/testthat/data/sample_config_no_exclusion.json b/tests/testthat/data/sample_config_no_exclusion.json index 2d81b7e..c028751 100644 --- a/tests/testthat/data/sample_config_no_exclusion.json +++ b/tests/testthat/data/sample_config_no_exclusion.json @@ -7,6 +7,7 @@ "min_reference_date": "2023-01-02", "max_reference_date": "2023-01-07", "report_date": "2023-10-28", + "production_date": "2024-10-28", "quantile_width": [0.5, 0.95], "model": "EpiNow2_test", "parameters": { diff --git a/tests/testthat/data/sample_config_with_exclusion.json b/tests/testthat/data/sample_config_with_exclusion.json index 5e8e61b..b92c8c1 100644 --- a/tests/testthat/data/sample_config_with_exclusion.json +++ b/tests/testthat/data/sample_config_with_exclusion.json @@ -7,6 +7,7 @@ "min_reference_date": "2023-01-02", "max_reference_date": "2023-01-07", "report_date": "2023-10-28", + "production_date": "2024-10-28", "quantile_width": [0.5, 0.95], "model": "EpiNow2_test", "parameters": { diff --git a/tests/testthat/test-pipeline.R b/tests/testthat/test-pipeline.R index 00fe617..96b5114 100644 --- a/tests/testthat/test-pipeline.R +++ b/tests/testthat/test-pipeline.R @@ -116,7 +116,11 @@ test_that("Runs on config from generator as of 2024-11-26", { expect_pipeline_files_written( output_dir, config@job_id, - config@task_id + config@task_id, + # Do not check for log output here, bc logs get created in + # `orchestrate_pipeline()`, and this test only calls `execute_model_logic()` + # which gets called after the log files have been created. + check_logs = FALSE ) })