Skip to content
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

Create lazy function that caches DANDI LinkML schema #11

Merged
merged 3 commits into from
Oct 7, 2024

Conversation

candleindark
Copy link
Member

This PR introduces DandisetLinkmlValidator.get_dandi_linkml_schema() that generates the LinkML schema for DANDI models lazily and caches the schema once it is generated. Without the changes in this PR. The generation of the schema is done as soon as the containing module is imported.

…andi models

This way, the translation of dandi models to LinkML is
only done on a needed basis
…class method

This eliminates the use of a private global variable
keep the schema
@candleindark candleindark merged commit 3c43c13 into dandi:main Oct 7, 2024
1 check passed
@candleindark candleindark deleted the dandi-linkml-schema-func branch October 7, 2024 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant