The submission file for the COVID-19 Forecast Hub must adhere to requirements for file format, column names, target identifiers, and date ranges for horizons. The organizers include Python scripts to validate weekly submission data. This function provides an R wrapper for one of the validation methods from the zoltpy Python module. In order to wrap the Python functionality, the function calls reticulate internally to attach the Python environment with zoltpy installed. Any changes made upstream (in zoltpy release on PyPi repository) will be propagated to this function given a fresh module installation (see "install" argument).

validate_forecast(filename, verbose = TRUE, install = FALSE, envname = NULL)

Arguments

filename

Full path to the forecast file to be checked

verbose

Logical indicating whether or not the output from this function should include validation message; default TRUE

install

Logical as to whether or not the python dependencies should be installed; if TRUE the module will be installed to the virtual environment specified in "envname"; default is FALSE

envname

Character vector specifying the name of the virtualenv to which the python dependencies should be installed if install = TRUE; default is NULL which will install the module to a virtualenv named r-reticulate

Value

If verbose = FALSE, the returned value will be a boolean with TRUE for valid submission file and FALSE for invalid file. If verbose = FALSE, the function will return a named list with two elements: "valid" (boolean with the TRUE/FALSE validation code) and "message" (the output from the zoltpy valid_quantile_csv_file() function).

References

https://pypi.org/project/zoltpy/

https://covid19forecasthub.org/