Giter Site home page Giter Site logo

Comments (5)

oeway avatar oeway commented on June 19, 2024

Is this already done?

I just check the schema, and noticed there are wired keys appeared in the root: optional_kwargs required_kwargs, why is that? @FynnBe

I am thinking maybe we should write the schema manually, in that case, will you be able to read a json schema file and use it in the python package?

from core-bioimage-io-python.

FynnBe avatar FynnBe commented on June 19, 2024

Is this already done?

yes, I forgot about this issue...

I just check the schema, and noticed there are wired keys appeared in the root: optional_kwargs required_kwargs, why is that? @FynnBe

The optional_kwargs and required_kwargs keys are there to specify any kwargs optional/required for model instantiation, as source points to a callable...

I am thinking maybe we should write the schema manually, in that case, will you be able to read a json schema file and use it in the python package?

we use marshmallow to specify the schema, which allows for more validation and exporting of the json schema (with a subset of the 'rules'). As marshmallow is more powerful, I would like to keep it this way.

What would you want to change manually? Maybe we can just adapt the schema in marshmallow accordingly?

from core-bioimage-io-python.

oeway avatar oeway commented on June 19, 2024

Thanks @FynnBe for the explanation.

The optional_kwargs and required_kwargs keys are there to specify any kwargs optional/required for model instantiation, as source points to a callable...

But this is not in our configuration specification right, is there a way to clean up the exported json schema?

What would you want to change manually? Maybe we can just adapt the schema in marshmallow accordingly?

I would like to make a model config generator/validator plugin in javascript, so users can build model config from an UI and we can add a badge for validated model cards. Even more, for those not validated ones we show an info button where the developer can click and we can show a list of errors, warnings and suggestions.

I can either redo it in javascript and make an bioengine app for that, or we can run the marshmallow validation when we compile the yaml file to the manifest json (in a CI), then add the validation report to the generated json file.

The JSON schema is also important, even though it's a subset of the rules, we can share it between different language (e.g. Java/JS).

Related to these, I have two additional questions:

  1. when I pass the yaml config to marshmallow to validate, can you generate a detailed report? Not just passed or failed, but ideally also more detailed information for different levels: error, warning, recommendation etc.

  2. For the generated JSON schema, can we clean it up to remove for example keys like required_kwargs, it's a bit confusing when we generate an HTML form with it and it has these keys.

from core-bioimage-io-python.

FynnBe avatar FynnBe commented on June 19, 2024

But this is not in our configuration specification right, is there a way to clean up the exported json schema?

For the generated JSON schema, can we clean it up to remove for example keys like required_kwargs, it's a bit confusing when we generate an HTML form with it and it has these keys.

sure thing, we can just drop them to have the models self-contained
Maybe we should add them to the specification, though? Let's discuss that in #31, and I'll remove them from the json schema for now.

  • remove kwargs from model json schema

I can either redo it in javascript and make an bioengine app for that, or we can run the marshmallow validation when we compile the yaml file to the manifest json (in a CI), then add the validation report to the generated json file.

Running a CI was the plan afaik... With the marshmallow schema we implemented a fast validation (format + easy to check cross field checks) and one that would require some more computation (running source code, etc..)

when I pass the yaml config to marshmallow to validate, can you generate a detailed report? Not just passed or failed, but ideally also more detailed information for different levels: error, warning, recommendation etc.

yes, exactly which field fails why and which fields collide

from core-bioimage-io-python.

FynnBe avatar FynnBe commented on June 19, 2024

from core-bioimage-io-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.