Comments (3)
Hey @LucieContamin
Thanks for the bug report!
The first error is because we are using the Suggests
to list packages that hub maintainers might need but users that just want to load data don't. This is because the V8
package that jsonvalidate
depends on can be annoying to install on Linux but is only required for the schema validation so we didn't want to require it for all users.
There's a note about it at the top of the vignette https://infectious-disease-modeling-hubs.github.io/hubUtils/articles/hub-setup.html but I knew that wasn't enough so I've added a check for it in the function. Now if the jsonvalidate
isn't installed when you call validate_config()
you get a more informative message with instructions.
I've pushed this change as well as the dynamic validation functionality to branch r-config-val
(still need to write more tests before it can be reviewed and merged).
You can install it with:
remotes::install_github("Infectious-Disease-Modeling-Hubs/hubUtils", ref = "r-config-val", dependencies = TRUE)
Use v0.0.1
schema
The latest schema version was (unreleased) on the v0.0.1
branch in the schemas repo but I've just gone ahead and released it on the main
branch for you.
Now if I run (in the megaround project):
library(hubUtils)
validate_config(config = "tasks")
I get:
Error in `get_config_schema_version()`:
! Valid version could not be extracted from config file
./hub-config/tasks.json
! Please check property "schema_version" is correct.
because there is no schema_version
property. This is necessary for validation to be performed correctly. (see https://github.com/Infectious-Disease-Modeling-Hubs/schemas/blob/c71c4e655dbf2cd293176d5cf421a3782aa13c66/v0.0.1/tasks-schema.json#L8-L12)
When I add:
"schema_version": "https://github.com/Infectious-Disease-Modeling-Hubs/schemas/blob/main/v0.0.1/tasks-schema.json",
above the rounds
property in your tasks.json
, I now get a single error relating to the fact you are using output_types
rather than output_type
.
Once I fix that, validation succeeds!!
Note that I've removed the automatic launching of a more user friendly error report. That now is in a separate function called view_config_val_errors()
. However the bug is somewhere in that function (which was triggered automatically in the previous version of hubUtils) so I will use your tasks.json
to figure out why it's causing view_config_val_errors()
to fail.
You can still access the errors table generated by jsonvalidate
package with:
out <- validate_config(config = "tasks")
attr(out, "errors")
from hubutils.
Hey @annakrystalli ,
Thank you very much for the detailed information. It makes more sense now.
For the install, I did not consult the vignette when I install the package I just look at the README, so might be interesting to add that information on the README too.
I will update the schema version and fix my output-type errors!
Thank you very much again
from hubutils.
Yes you're totally right about the README
. It definitely needs to be mentioned there.
from hubutils.
Related Issues (20)
- Export `json_datatypes` for use in hubValidations HOT 1
- Errors in flusight example hub quantile values data type HOT 2
- validate a hub's `model-metadata-schema.json` config file
- function to load model metadata HOT 6
- validate existence and correct formatting of `hub-config/model-metadata-schema.json`
- create man page for `model_out_tbl` class
- split this package into three packages for different intended audiences HOT 8
- `create_task_id()` for `origin_date` returns an error if required = Date object HOT 3
- Improve output message of connect_hub() HOT 1
- Update authors HOT 4
- add hard-coded global variables or datasets with common location codes HOT 4
- argument alignment for create_output_type_*() functions HOT 2
- minimum and maximums for output_types HOT 1
- problem specifying value_minimum and value_maximum in create_output_type_sample() HOT 2
- Upgrade Docs to hubStyle
- Replace ~ with \(x) in purrr calls that trigger object_usage_linter errors HOT 2
- [WIP] Package split questions HOT 2
- Add function like `get_task_ids_tbl`
- [ORG NAME CHANGE]: Update repo to hubverse-org organisation name HOT 1
- Function to get ordered levels of `output_type_id`s for pmf or categorical output types
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hubutils.