-
Notifications
You must be signed in to change notification settings - Fork 17
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
expanding validator and auto-conversion #107
Comments
Sorry, but I think this is fundamentally wrong. We should not use the marshmallow spec here, but use the jsonschema, which is considered the source of truth for the (non-model) rdf. Otherwise we are back to the same situation of having different references. I think all validation of (non-model) rdfs should be removed from the marshmallow schema and done through the jsonschema. Once that is done we can think about updating the author and documentation field in the jsonschema to have it in sync between the model.rdf and the other rdfs. |
I think it would be easier to maintain and develop if we viewed all RDFs under one format version and define and validate all of it in marshmallow. Why should |
I can make a draft of the general rdf in marshmallow at the end of this week. Maybe then it'll be easier to discuss... |
Yes, definitely.
Having it under the same format version does not mean we have to do it in marshmallow. Putting the RDF in jsonschema is something we have decided on a while ago with @oeway (we can of course reconsider that decision). So given that decision validating it with marshmallow is wrong, and leads to the failures in the validator we are seeing.
I think this would indeed be good, but currently the definitions are different and we cannot just silently assume that they were updated. Also, for some of the fields the definition between model and rdf is contradicting, e.g.
Edit: Just to make my point clear here: I am not against unifying this, but we need to be careful with introducing very large changes (e.g. validating the rdf based on marshmallow instead of the jsonschema), without coordinating this, as this yields a lot of confusion. If we decide to use marshmallow as the "source of truth" for the rdf as well, this definitely requires a bump in the version. |
I suggest that more specialized specs like the model spec may overwrite the general rdf spec, e.g. for documentation. Of course it is desirable to have them as homogenous as straight forwardly possible |
I would actually prefer not moving the generic RDF spec to marshmallow, although there is no fundamental difference since we can generate the jsonschema ultimately. But I felt it somewhat more correct if we keep it in jsonschema, because:
Also consider that we may define more spec for dataset/notebooks/applications, I felt it's better to do it in jsonschema, more strightforward (no need to use CI to generate the josnschema), and also aviod touching the model spec part. |
my 4 cents:
model packages don't need to use python/marshmallow either, e.g. for javascript based models...
again, the exported jsonschema could serve as missionary for the single source marshmallow truth
that makes the marshmallow code very simple, that's great! It's not longer than jsonschema and we can reuse fields like
for me more more reason to specify everything in marshmallow. Also note that the jsonschema could be generated just like I setup generation of the documentation: with a pre-commit ensuring that the commited file is "freshly generated" from the current HEAD. For the documentation this has worked really nicely and would result in a commited jsonschema with history in jsonschema, etc.. |
From my side there are arguments for both positions, just to mention the two main points:
I think overall my vote would be to unify, but if we do this we need some proper developer docs on the marshmallow schema, because having two different frameworks for this is confusing in the long run. |
👍 I'd say we need those anyway! |
OK, let's do it in marshmallow then, it won't be too hard to grasp I guess. However, I would rather implement the generation of docs and schema in CI in order to make sure they are synchronized. Edit: I am working on the CI now #115 |
I think this issue is resolved. |
after
the models all pass the spec, but there are two remaining problems:
format_version
of manifest is the model format version, not the rdf format version. Unifying the format versions would be great (see _maybe_ update manifest versions #101)authors
anddocumentation
to the notebooks as well (to all other rdfs really).I propose to extend the auto-conversion mechanism and a unified format version to all rdf by specifying all rdfs with marshmallow based schemas and generate their respective documentations like the model one.
The schema.Model
spec-bioimage-io/bioimageio/spec/v0_3/schema.py
Line 481 in 666db26
spec-bioimage-io/bioimageio/spec/v0_3/schema.py
Line 54 in 666db26
#106 aims at correcting this base RDF schema
For manifest validation
spec-bioimage-io/bioimageio/spec/v0_3/schema.py
Line 715 in 666db26
and
spec-bioimage-io/bioimageio/spec/v0_3/schema.py
Line 693 in 666db26
already exist and only need minor improvements, e.g. update documentation.
The text was updated successfully, but these errors were encountered: