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

Major refactoring to support more thorough conversion of dandischema pydantic models #1

Merged
merged 205 commits into from
Oct 15, 2024

Conversation

yarikoptic
Copy link
Member

@yarikoptic yarikoptic commented Jul 23, 2024

Done locally to replace

This PR improves the existing conversion from Pydantic models to LinkML the following areas:

  1. Improve enum conversion so that different slots within the EnumDefinition metamodel are populated more accurately
  2. Add more detailed slots population
  3. Add slot usage in class population
  4. Provide a more accurate interpretation of slots/attributes in a class, by eliminating misinterpretation of a class variable in a Pydantic model as a slot for example.
  5. Provide notes to inform issues encounter in the conversion
  6. Specify limitations of this conversion tool in README.md
  7. Provide more tests to improve coverage
  8. Reorganized code so that additional support can be added more easily
  9. Provide a solution in handling a Pydantic model that has multiple parents that are also Pydantic models.
  10. Organize this repo into a Python project using Hatch
  11. Enable CLI to be installed as part of the project installation.

Allow classes to be input as positional argument makes
the function more portable
This func is intended to be used for converting
a docstring to description in metadata in a
LinkML schema
A method that adds the slots construed from
the models in `self._models` to the schema
In generate_linkml_from_aind.py
`fetch_defs()` is a function for fetching Python objects
from given modules that provide schema definitions
Pydantic 2.9 adds support of validation of complex numbers.
To be compatible with Pydantic 2.9, We need this interface
defined.
Pydantic 2.8 doesn't have "core_schema.ComplexSchema"
needed in the current code. Let's support Pydantic 2.8
only when needed
Due to the transfer of the project to the DANDI
organization on github
…rsion

With this contingency in place Pydantic no longer need to be
2.9 or greater
@candleindark
Copy link
Member

Merging this into main per @yarikoptic's request. The PR has already grown to the point that meaningful review is not practical.

@candleindark candleindark merged commit fdf4828 into main Oct 15, 2024
3 checks passed
@candleindark candleindark deleted the enh branch October 15, 2024 16:44
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.

2 participants