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

21/22/ Add note about two stage validation / remove hard coded location data #23

Merged
merged 3 commits into from
Jun 3, 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
30 changes: 0 additions & 30 deletions R/data.R

This file was deleted.

13 changes: 12 additions & 1 deletion R/validate_config.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
#' 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`](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.
#' 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
Expand Down
16 changes: 14 additions & 2 deletions R/validate_hub_config.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
#' Validate Hub config files against Infectious Disease Modeling Hubs schema.
#' Validate Hub config files against hubverse 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`](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.
#' 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`
Expand Down
13 changes: 0 additions & 13 deletions data-raw/hub_locations.R

This file was deleted.

Binary file removed data/hub_locations_eu.rda
Binary file not shown.
Binary file removed data/hub_locations_us.rda
Binary file not shown.
20 changes: 0 additions & 20 deletions man/hub_locations_eu.Rd

This file was deleted.

28 changes: 0 additions & 28 deletions man/hub_locations_us.Rd

This file was deleted.

16 changes: 14 additions & 2 deletions man/validate_config.Rd

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

18 changes: 16 additions & 2 deletions man/validate_hub_config.Rd

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