Allow for model excluded fields in MPDataDoc construction#989
Allow for model excluded fields in MPDataDoc construction#989tschaume merged 9 commits intomaterialsproject:mainfrom
Conversation
|
Think I may have gotten the should correctly return pydantic documents now The alternate solution would be ensuring emmet has no forward references, but that will require a redeploy |
tschaume
left a comment
There was a problem hiding this comment.
Thanks @esoteric-ephemera! As this does not seem to break backward-compatibility, I'm ok with merging and releasing a new version to take care of the phonon issue. Unfortunately, the test for PhononRester still fails - same on my local machine. I ran the tests against the adkaplan-tls branch in this repo since secrets (in this case API keys) are not forwarded to forks.
|
Thanks @tschaume, the issue was not importing external Also there's an undocumented pydantic kwarg that makes it cleaner to include external locals in a model. Making use of that now |
Depends on emmet-core #1253, which adds a top-level structure field to
PropertyDocOn
model_dump, thestructurefield should be excluded, and should not appear in the JSON schema. This adds parsing of the exclude attr of a model field inapi_sanitize