-
Notifications
You must be signed in to change notification settings - Fork 5
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
validation of inputs #24
Comments
So implement on both levels:
|
This looks interesting for validating Arrow tables: https://github.com/beacon-biosignals/Legolas.jl/. It is used in https://github.com/beacon-biosignals/LegolasFlux.jl/. |
|
for this moment we can have data struct duplications (julia, plugin, python) For future revisit if we want to move to Rust-CLI (#90) doing validation before handing over to julia. This could be used by python and plugin as well. |
Ok, so ideally, we generate a schema (jsonschema) from a single source, and use that in all other code. For me, that looks like: Julia -> Jsonschema -> Python / QGIS The main reason is because Julia has to be able to compute with the input, so it has to be compatible there. One can generate Pydantic BaseModels in Python from jsonschemas. These can be used in Pandera as well, although it might be slower. There's an open issue for Pandera to directly generate Pandera models from jsonschema, feel free to upvote it. |
|
…atic postfix. (#166) Fixes #24 Fixes #144 Now one only needs to specify a new schema and record in `validation.jl`, from which both the Config as the validation will be triggered. This is completely discoupled from the compute types, the connection is only made on the call to load_data like `data = load_data(db, config, TabulatedRatingCurveStaticV1)`. Note that I've taken the liberty to already append `static` to all base tables, so this requires new geopackages. I've also inversed the `Config` to have a [basin] key with forcing underneath instead of [forcing] with basin underneath. One can generate jsonschema's with `julia --project=core scripts/gen_schema.jl`. These end up in the docs/schema folder, which will then be live on the website as well. In another PR I will automate the Python and QGIS code based on these schemas. Incremental changes to validation can be made now by a single line change, like `node_id::Int = clamp(node_id, 0, typemax(Int))`. --------- Co-authored-by: Martijn Visser <[email protected]>
Enable validation of input:
The text was updated successfully, but these errors were encountered: