materialsproject / emmet

Be a master builder of databases of material properties. Avoid the Kragle.
https://materialsproject.github.io/emmet/
Other
52 stars 64 forks source link

Add `summary_stats` attr to `emmet.core.vasp.calculation.PotcarSpec` #874

Closed esoteric-ephemera closed 9 months ago

esoteric-ephemera commented 10 months ago

For consistency with pymatgen, which now includes the ability to validate POTCARs without hashing (see PMG PR #3351), added a summary_stats attribute to emmet.core.vasp.calculation.PotcarSpec.

summary_stats is just a dict with structure

self._summary_stats = {
    "keywords": {
        "header": list[str],
        "data": list[str]
    },
    "stats": {
        "header": dict[float],
        "data": dict[float]
    }
}

This will help in adding new the POTCAR validation scheme to emmet.

codecov-commenter commented 9 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (ebbe8d5) 91.36% compared to head (534e843) 91.35%. Report is 5 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #874 +/- ## ========================================== - Coverage 91.36% 91.35% -0.01% ========================================== Files 138 138 Lines 12748 12748 ========================================== - Hits 11647 11646 -1 - Misses 1101 1102 +1 ``` | [Files](https://app.codecov.io/gh/materialsproject/emmet/pull/874?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=materialsproject) | Coverage Δ | | |---|---|---| | [emmet-core/emmet/core/vasp/calculation.py](https://app.codecov.io/gh/materialsproject/emmet/pull/874?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=materialsproject#diff-ZW1tZXQtY29yZS9lbW1ldC9jb3JlL3Zhc3AvY2FsY3VsYXRpb24ucHk=) | `76.26% <100.00%> (+0.07%)` | :arrow_up: | ... and [4 files with indirect coverage changes](https://app.codecov.io/gh/materialsproject/emmet/pull/874/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=materialsproject)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

janosh commented 9 months ago

Would be good to add a test for the summary_stats attribute in emmet-core/tests/test_calculation.py.