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

MoleculeMetadata set model config allow='extra' #857

Merged
merged 5 commits into from
Oct 13, 2023

Conversation

janosh
Copy link
Member

@janosh janosh commented Oct 12, 2023

Fixes breaking test_cclib_taskdoc in materialsproject/atomate2#548.

Failing lines that require allow='extra'.

2nd fix needed for atomate2 tests following #853.

@janosh janosh added Core Any updates for Emmet-Core fix Bug fix pydantic pydantic-related PRs and issues labels Oct 12, 2023
@codecov-commenter
Copy link

codecov-commenter commented Oct 12, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (2f6119b) 91.35% compared to head (9396be4) 91.35%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #857   +/-   ##
=======================================
  Coverage   91.35%   91.35%           
=======================================
  Files         138      138           
  Lines       12747    12747           
=======================================
  Hits        11645    11645           
  Misses       1102     1102           
Files Coverage Δ
emmet-core/emmet/core/base.py 100.00% <100.00%> (ø)
emmet-core/emmet/core/structure.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@munrojm
Copy link
Member

munrojm commented Oct 12, 2023

The issue with this is that the metadata model is inherited by a lot of other documents. This effectively destroys validation for them. Can we not just enable extra fields on TaskDocument like we do with the VASP equivalent (

class TaskDoc(StructureMetadata, extra="allow"):
)?

@janosh
Copy link
Member Author

janosh commented Oct 12, 2023

@munrojm That works too. I now test that extra fields are ignored and will set extra='allow' here instead.

@munrojm munrojm added the release:patch Patch updates label Oct 13, 2023
@munrojm munrojm merged commit 40145d3 into main Oct 13, 2023
10 checks passed
@janosh janosh deleted the molecule-meta-allow-extra branch October 13, 2023 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Core Any updates for Emmet-Core fix Bug fix pydantic pydantic-related PRs and issues release:patch Patch updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants