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

Fix serialization issue in XASDoc #1146

Merged
merged 3 commits into from
Dec 3, 2024

Conversation

esoteric-ephemera
Copy link
Collaborator

Adds a field_validator to XASDoc to check that the spectrum only has positive intensities (related pymatgen PR). If a spectrum has non-positive intensities, they are set to a small positive value (like zeroing out, but needs to be positive in this case).

Also adds a test for the new behavior (previously no tests for XASDoc)

@codecov-commenter
Copy link

codecov-commenter commented Nov 22, 2024

Codecov Report

Attention: Patch coverage is 46.66667% with 8 lines in your changes missing coverage. Please review.

Project coverage is 86.94%. Comparing base (a705a61) to head (7846e7d).

Files with missing lines Patch % Lines
emmet-core/emmet/core/xas.py 46.66% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1146      +/-   ##
==========================================
- Coverage   90.42%   86.94%   -3.49%     
==========================================
  Files         147       83      -64     
  Lines       14448    11614    -2834     
==========================================
- Hits        13065    10098    -2967     
- Misses       1383     1516     +133     

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

@tsmathis tsmathis merged commit 3e903a4 into materialsproject:main Dec 3, 2024
8 checks passed
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.

3 participants