-
Notifications
You must be signed in to change notification settings - Fork 89
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
[pydanticgen] implement string_serialization
#2053
base: main
Are you sure you want to change the base?
[pydanticgen] implement string_serialization
#2053
Conversation
…pliance tests to not close expected python annotations. make arraytypes a string enum
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2053 +/- ##
==========================================
- Coverage 80.67% 79.67% -1.00%
==========================================
Files 107 108 +1
Lines 11943 12036 +93
Branches 3415 3436 +21
==========================================
- Hits 9635 9590 -45
- Misses 1743 1867 +124
- Partials 565 579 +14 ☔ View full report in Codecov by Sentry. |
That should render recursively, so since the fields of a linkml pydantic model are occasionally also linkml models that can also have their own string serializations, we have a composable templating system. Since We will have a Turing complete self describing code generator soon at this rate lmao |
depends on:
merging [pydanticgen] Embed extra metadata in modules, classes, and fields #2036
this PR builds on [pydanticgen] Embed extra metadata in modules, classes, and fields #2036, see the diff between branches for what is unique to this PR
couldn't sleep, saw this earlier while doing #2052 and had a whacky idea
so like
becomes
which of course works like
so one could imagine the metaprogramming possibilities that could be had if one were to eval (after, perhaps, safely escaping) a string that looked like another model or format and so on.
also this is just a demonstration of 𝓉𝒽𝑒 𝒻𝓊𝓃𝓏𝒾𝑒𝓈 𝓉𝑜 𝒷𝑒 𝒽𝒶𝒹 with the pydanticgen templating system :)
@cmungall i also added a little sketch of a pytest-fixture based complement to the compliance framework - the teeniest, tiniest hookable version. obvs it doesn't implement all the semantics of the existing compliance framework, but i'm thinking about how it would be nice to be able to surface some of what happens in the
helper
module, and allow for both 'proper' compliance tests alongside the ability to allow tests that might not fit well there to declare that a certain test implements a part of the metamodel. just a quick idea :)