From fc2fb800f800ce9c1f99c301a53f81b64e202730 Mon Sep 17 00:00:00 2001 From: Anna Krystalli Date: Mon, 3 Jun 2024 14:42:52 -0400 Subject: [PATCH 1/3] Resolves #21 add note about dynamic validations only being perfomed if basic schema validation passes --- R/validate_config.R | 12 +++++++++++- R/validate_hub_config.R | 13 ++++++++++++- man/validate_config.Rd | 15 +++++++++++++-- man/validate_hub_config.Rd | 15 ++++++++++++++- 4 files changed, 50 insertions(+), 5 deletions(-) diff --git a/R/validate_config.R b/R/validate_config.R index 576c33c..15a77aa 100644 --- a/R/validate_config.R +++ b/R/validate_config.R @@ -1,5 +1,15 @@ -#' Validate a hub config file against a Infectious Disease Modeling Hubs schema +#' Validate a hub config file against a hubverse schema #' +#' This function validates a single hub config file against it's corresponding +#' schema. +#' Note that, for `tasks.json` config files, validation is performed +#' in two stages: +#' 1. Initial validation against the schema is performed using the [`jsonvalidate`] +#' package which uses the `"ajv"` (Another JSON Schema Validator) validation engine. +#' 2. If the initial validation is successful, additional dynamic validations are +#' performed. +#' This means that only after the initial validation passes, will any dynamic +#' validation errors be detected. #' @param hub_path Path to a local hub directory. #' @param config Name of config file to validate. One of `"tasks"` or `"admin"`. #' @param config_path Defaults to `NULL` which assumes all config files are in diff --git a/R/validate_hub_config.R b/R/validate_hub_config.R index 4be2d01..e0f9dfb 100644 --- a/R/validate_hub_config.R +++ b/R/validate_hub_config.R @@ -1,6 +1,17 @@ #' Validate Hub config files against Infectious Disease Modeling Hubs schema. #' -#' Validate the `admin.json` and `tasks.json` Hub config files in a single call. +#' Validate the `admin.json`, `tasks.json` and `model-metadata-schema.json` Hub +#' config files in a single call. +#' Note that, for `tasks.json` and `model-metadata-schema.json` config files, +#' validation is performed in two stages: +#' 1. Initial validation against the schema is performed using the [`jsonvalidate`] +#' package which uses the `"ajv"` (Another JSON Schema Validator) validation engine. +#' In the case of `model-metadata-schema.json`, `jsonvalidate` just checks that +#' the file is valid JSON and can be parsed correctly. +#' 2. If the initial validation is successful, additional dynamic validations are +#' performed. +#' This means that only after the initial validation passes, will any dynamic +#' validation errors be detected. #' @inheritParams validate_config #' #' @return Returns a list of the results of validation, one for each `hub-config` diff --git a/man/validate_config.Rd b/man/validate_config.Rd index 7ace935..391a2ea 100644 --- a/man/validate_config.Rd +++ b/man/validate_config.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/validate_config.R \name{validate_config} \alias{validate_config} -\title{Validate a hub config file against a Infectious Disease Modeling Hubs schema} +\title{Validate a hub config file against a hubverse schema} \usage{ validate_config( hub_path = ".", @@ -46,7 +46,18 @@ You can print a more concise and easier to view version of an errors table with \code{\link[=view_config_val_errors]{view_config_val_errors()}}. } \description{ -Validate a hub config file against a Infectious Disease Modeling Hubs schema +This function validates a single hub config file against it's corresponding +schema. +Note that, for \code{tasks.json} config files, validation is performed +in two stages: +\enumerate{ +\item Initial validation against the schema is performed using the \code{\link{jsonvalidate}} +package which uses the \code{"ajv"} (Another JSON Schema Validator) validation engine. +\item If the initial validation is successful, additional dynamic validations are +performed. +This means that only after the initial validation passes, will any dynamic +validation errors be detected. +} } \examples{ # Valid config file diff --git a/man/validate_hub_config.Rd b/man/validate_hub_config.Rd index cd0212c..b684fbb 100644 --- a/man/validate_hub_config.Rd +++ b/man/validate_hub_config.Rd @@ -38,7 +38,20 @@ You can print a more concise and easier to view version of an errors table with \code{\link[=view_config_val_errors]{view_config_val_errors()}}. } \description{ -Validate the \code{admin.json} and \code{tasks.json} Hub config files in a single call. +Validate the \code{admin.json}, \code{tasks.json} and \code{model-metadata-schema.json} Hub +config files in a single call. +Note that, for \code{tasks.json} and \code{model-metadata-schema.json} config files, +validation is performed in two stages: +\enumerate{ +\item Initial validation against the schema is performed using the \code{\link{jsonvalidate}} +package which uses the \code{"ajv"} (Another JSON Schema Validator) validation engine. +In the case of \code{model-metadata-schema.json}, \code{jsonvalidate} just checks that +the file is valid JSON and can be parsed correctly. +\item If the initial validation is successful, additional dynamic validations are +performed. +This means that only after the initial validation passes, will any dynamic +validation errors be detected. +} } \examples{ validate_hub_config( From b5cae00121d73798db82df5ff631f19e552e1192 Mon Sep 17 00:00:00 2001 From: Anna Krystalli Date: Mon, 3 Jun 2024 15:02:37 -0400 Subject: [PATCH 2/3] Resolves #22. Remove hard-coded location datasets --- R/data.R | 30 ------------------------------ data-raw/hub_locations.R | 13 ------------- data/hub_locations_eu.rda | Bin 473 -> 0 bytes data/hub_locations_us.rda | Bin 20542 -> 0 bytes man/hub_locations_eu.Rd | 20 -------------------- man/hub_locations_us.Rd | 28 ---------------------------- 6 files changed, 91 deletions(-) delete mode 100644 R/data.R delete mode 100644 data-raw/hub_locations.R delete mode 100644 data/hub_locations_eu.rda delete mode 100644 data/hub_locations_us.rda delete mode 100644 man/hub_locations_eu.Rd delete mode 100644 man/hub_locations_us.Rd diff --git a/R/data.R b/R/data.R deleted file mode 100644 index fe7b0ae..0000000 --- a/R/data.R +++ /dev/null @@ -1,30 +0,0 @@ -#' Available US locations -#' -#' Data set with available locations for a US hub -#' -#' @format A data frame with 3202 rows and 5 columns: -#' \describe{ -#' \item{fips}{FIPS code} -#' \item{location_name}{Location name} -#' \item{geo_type}{Type of location for compatibility with -#' \href{https://cmu-delphi.github.io/delphi-epidata/api/covidcast_geography.html -#' }{EpiData API geographic codings} -#' } -#' \item{geo_value}{Location abbreviation or FIPS code for compatibility with -#' \href{https://cmu-delphi.github.io/delphi-epidata/api/covidcast_geography.html -#' }{EpiData API geographic codings}} -#' \item{abbreviation}{Corresponding state abbrevaition} -#' } -"hub_locations_us" - - -#' Available European locations -#' -#' Data set with available European locations used in ECDC hubs -#' -#' @format A data frame with 32 rows and 2 columns: -#' \describe{ -#' \item{location_name}{Name of the location} -#' \item{location}{Location abbreviation} -#' } -"hub_locations_eu" diff --git a/data-raw/hub_locations.R b/data-raw/hub_locations.R deleted file mode 100644 index b1aed53..0000000 --- a/data-raw/hub_locations.R +++ /dev/null @@ -1,13 +0,0 @@ -## code to prepare `hub_locations` dataset goes here -library(dplyr) -hub_locations_us <- covidHubUtils::hub_locations |> - select(-population, -full_location_name) |> - tibble::as_tibble() - -hub_locations_eu <- covidHubUtils::hub_locations_ecdc |> - select(-population) |> - tibble::as_tibble() - -usethis::use_data(hub_locations_us, overwrite = TRUE) - -usethis::use_data(hub_locations_eu, overwrite = TRUE) diff --git a/data/hub_locations_eu.rda b/data/hub_locations_eu.rda deleted file mode 100644 index 1f8a168f13d2207d60d906c196b2b8417fb95460..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 473 zcmV;~0Ve)JT4*^jL0KkKS?p$`=>P$Lf5HFzNB}?q5CA{#-*CV0-|#>HKmY&%umO6T zYf#kCnJ210N^HoQWFR#3j}-MZ+L<&1M$`>cGLKV44FvTx^crXyAjhFWlOci$O+?YE zdY`F1Ks03a8UO>-0i)3d)b$Pus+52YN4h8&Eli6d_!)2glLH@1CH{{XF_=IY4K#G> zvrSsyu@;~s!1Wm1IpOA@aoQ((%0UbTpx{vRR4zzE<;UZ(QcaNtgf)$VUHjgK`W@5d9ku&a@(e!*58I=f>KRfueX4|? z)pmy1>yDYFJ9$eJir&Mptrbli0)_ihibIm^!P8Q^SD P75*;dig2MJ*v&`MPY2+u diff --git a/data/hub_locations_us.rda b/data/hub_locations_us.rda deleted file mode 100644 index 5ca043dfbc00b6420a14d043c332095ca5b2f1ec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20542 zcmcJ$1wd3=*D#ETUIawCyQQQ>O1c|{2BkX%q!py4yOD;Wq=p6+WTYiW7|9V3kdl

UbWXbNE_MRmT4%p>%vhK9hvQOVEG&o?ye z)&8LD^a-tm7tCl3O;iGRF;ZQii;?5_MZNcwp=c57YQN|`OpG*QY1>k_?3a?(_vHvw z&~Z`|vephhaU#R-Ah= z$+V5GGzUs*ma`FjTGe+bo2=_iSLyZpV;4Vhvj-XzoBJ!N7x(u=V8%vYV5IPwxB!pQp6{nkoqosm z3*Y^Z*GwyxzGvGs&$xeg%IU7Z@A}~){=;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=?alT^k*snn`msKTQn-SSs!4kA448bgy9)$D zd-{?54Z$rlBZuAr0#TkuT$j~+_oLPEfK`qw_tzh+UUbJp$~3r|xd?+#in=4V4ZgEa zp8M^qYx?ex_~vwo$_8Z}GaiV6?{$oJ?LM~6)hTAZBH`b1BctowfFQ>I`)Eb0GQ)BG zBieO2-I+k4ow~1LZG}OQRMFP$v)8dck00MiW^b@J{ElY7aIiNx?E6D{LINwK{9Qzr zhxzf<+kZsp-;}*~n=0$vw{Awmg2QjxZ{~h})2_i3i25lW9>!jMkw2#^c{+}Z{&GIi zHg(v8B0O-%H`uP;HEsrr1jcXdPWM_)PFbIrYs9_vh_UN_;<96x9u)XE8#}QqI3|GW z{G81vVE_KLGwr8evRiLVHPa8)rjO*@qP^;P@IX-ZqrYEF*F*c6t9>u2!rt%rsI_j; zD0D}x%(Wd`nRGMI9#`ycuy#sU^V-x`ij+ntuydJVJQ5KWWfzGTJ6mitR;d0Q7me+u zyQS|AogQ#}=-O3aqbQps8^QzzQ7Q^4X<0>#|IpiiqhXbwEA(8G8{FG{KduZ?@lmMr z!K!<|Sl-D459yVhH{Wq^??3xGh8Ew>c%AW1oPDLQ6-Fj8u@=6R_S^Jr^JcySx7)Rm zgvGTM`zw`>iwWOy_A)&RV%k`euJc}vV=NL5x^K1(e)@u)PM-iAjaHijI!@TYrZsSP zWgotovU4PDY%erip0j#e>RGO1)uwbdTYLQo-hfE{_}s&i9IdI2y2c33q!Q9o0`mK= zIh#gRANP_C1CM#eFkpK2T&`MP?c8&I=l9Ona;|J=oUfCpoD0`uN>(>9^1sr4`uKV( zaqo2}+lhw}nt>lmQl-}rk5#Am>zma0zl+Cm8WVioxGwSIS!4e34c716pQ7Cg=wsfR G6#gH9qU)Cc diff --git a/man/hub_locations_eu.Rd b/man/hub_locations_eu.Rd deleted file mode 100644 index 625cd37..0000000 --- a/man/hub_locations_eu.Rd +++ /dev/null @@ -1,20 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{hub_locations_eu} -\alias{hub_locations_eu} -\title{Available European locations} -\format{ -A data frame with 32 rows and 2 columns: -\describe{ -\item{location_name}{Name of the location} -\item{location}{Location abbreviation} -} -} -\usage{ -hub_locations_eu -} -\description{ -Data set with available European locations used in ECDC hubs -} -\keyword{datasets} diff --git a/man/hub_locations_us.Rd b/man/hub_locations_us.Rd deleted file mode 100644 index c2a675c..0000000 --- a/man/hub_locations_us.Rd +++ /dev/null @@ -1,28 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{hub_locations_us} -\alias{hub_locations_us} -\title{Available US locations} -\format{ -A data frame with 3202 rows and 5 columns: -\describe{ -\item{fips}{FIPS code} -\item{location_name}{Location name} -\item{geo_type}{Type of location for compatibility with -\href{https://cmu-delphi.github.io/delphi-epidata/api/covidcast_geography.html -}{EpiData API geographic codings} -} -\item{geo_value}{Location abbreviation or FIPS code for compatibility with -\href{https://cmu-delphi.github.io/delphi-epidata/api/covidcast_geography.html -}{EpiData API geographic codings}} -\item{abbreviation}{Corresponding state abbrevaition} -} -} -\usage{ -hub_locations_us -} -\description{ -Data set with available locations for a US hub -} -\keyword{datasets} From e1ac013e8d0296c8e49305a638e65c71e08fa93b Mon Sep 17 00:00:00 2001 From: Anna Krystalli Date: Mon, 3 Jun 2024 15:32:54 -0400 Subject: [PATCH 3/3] add full URL to jsonvalidate --- R/validate_config.R | 3 ++- R/validate_hub_config.R | 5 +++-- man/validate_config.Rd | 3 ++- man/validate_hub_config.Rd | 5 +++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/R/validate_config.R b/R/validate_config.R index 15a77aa..14e9ea5 100644 --- a/R/validate_config.R +++ b/R/validate_config.R @@ -4,7 +4,8 @@ #' schema. #' Note that, for `tasks.json` config files, validation is performed #' in two stages: -#' 1. Initial validation against the schema is performed using the [`jsonvalidate`] +#' 1. Initial validation against the schema is performed using the +#' [`jsonvalidate`](https://docs.ropensci.org/jsonvalidate/) #' package which uses the `"ajv"` (Another JSON Schema Validator) validation engine. #' 2. If the initial validation is successful, additional dynamic validations are #' performed. diff --git a/R/validate_hub_config.R b/R/validate_hub_config.R index e0f9dfb..9d85004 100644 --- a/R/validate_hub_config.R +++ b/R/validate_hub_config.R @@ -1,10 +1,11 @@ -#' Validate Hub config files against Infectious Disease Modeling Hubs schema. +#' Validate Hub config files against hubverse schema. #' #' Validate the `admin.json`, `tasks.json` and `model-metadata-schema.json` Hub #' config files in a single call. #' Note that, for `tasks.json` and `model-metadata-schema.json` config files, #' validation is performed in two stages: -#' 1. Initial validation against the schema is performed using the [`jsonvalidate`] +#' 1. Initial validation against the schema is performed using the +#' [`jsonvalidate`](https://docs.ropensci.org/jsonvalidate/) #' package which uses the `"ajv"` (Another JSON Schema Validator) validation engine. #' In the case of `model-metadata-schema.json`, `jsonvalidate` just checks that #' the file is valid JSON and can be parsed correctly. diff --git a/man/validate_config.Rd b/man/validate_config.Rd index 391a2ea..6b8f141 100644 --- a/man/validate_config.Rd +++ b/man/validate_config.Rd @@ -51,7 +51,8 @@ schema. Note that, for \code{tasks.json} config files, validation is performed in two stages: \enumerate{ -\item Initial validation against the schema is performed using the \code{\link{jsonvalidate}} +\item Initial validation against the schema is performed using the +\href{https://docs.ropensci.org/jsonvalidate/}{\code{jsonvalidate}} package which uses the \code{"ajv"} (Another JSON Schema Validator) validation engine. \item If the initial validation is successful, additional dynamic validations are performed. diff --git a/man/validate_hub_config.Rd b/man/validate_hub_config.Rd index b684fbb..1dcebea 100644 --- a/man/validate_hub_config.Rd +++ b/man/validate_hub_config.Rd @@ -2,7 +2,7 @@ % Please edit documentation in R/validate_hub_config.R \name{validate_hub_config} \alias{validate_hub_config} -\title{Validate Hub config files against Infectious Disease Modeling Hubs schema.} +\title{Validate Hub config files against hubverse schema.} \usage{ validate_hub_config( hub_path = ".", @@ -43,7 +43,8 @@ config files in a single call. Note that, for \code{tasks.json} and \code{model-metadata-schema.json} config files, validation is performed in two stages: \enumerate{ -\item Initial validation against the schema is performed using the \code{\link{jsonvalidate}} +\item Initial validation against the schema is performed using the +\href{https://docs.ropensci.org/jsonvalidate/}{\code{jsonvalidate}} package which uses the \code{"ajv"} (Another JSON Schema Validator) validation engine. In the case of \code{model-metadata-schema.json}, \code{jsonvalidate} just checks that the file is valid JSON and can be parsed correctly.