-
Notifications
You must be signed in to change notification settings - Fork 180
feat: Compile schema.json and bundle in Python package #2115
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
feat: Compile schema.json and bundle in Python package #2115
Conversation
quick one, am I correct to assume that then it would "hardcode" python validator to
To avoid "yes" to any of those questions, I would have thought for us to keep edit: nwb&pynwb are experiencing various issues due to pretty much such tight coupling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
per my comment in the main thread, I do not think we should ship any version of the schema with the tools.
Wrote a response, but apparently didn't finish or hit "Comment". The schema is already bundled with the tools. This PR:
If you want to remove the schema from the tools, that will definitely be a breaking change, and will require rethinking the whole package. |
@yarikoptic Want to join the schema call to discuss this? |
sorry, was/is busy... ok, so it is (as described) just for the sake of speed performance, gotcha... boost is significant indeed, so let's go for it. |
In bids-standard/python-validator#2, I'm generating classes on the fly from
schema.meta.context
. As it stands, the import takes about 530ms on my machine, about 470ms of it spent loading the schema and constructing the classes.This change builds
schema.json
during the Python packaging process and includes it instead of the YAML directory inside the tarball and wheel. Along with deferring a couple imports (here and in #2109), this brings the import time down to about 35ms, with 10ms spent on loading the schema and building the classes.Editable installs are left loading YAML files, to avoid caching an old state.