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

Add new error handlers, add tests for NonConvergingErrorHandler #313

Merged
merged 9 commits into from
Feb 2, 2024

Conversation

esoteric-ephemera
Copy link
Contributor

@esoteric-ephemera esoteric-ephemera commented Feb 1, 2024

Add error handling for

  • PDSYEVX (analogous to PSSYEVX), possibly reflecting updated LAPACK routines in vasp 6
  • PRICELV, similar error handling as POSMAP, see VASP forum discussion
  • PSMAXN when a calculation doesn't converge electronically or ionically. I see there was earlier discussion of PSMAXN in #133, but handling was dropped from #134
  • Tests for the above, and NonConvergingErrorHandler to close #300
  • Replaced all POTCARs with fake ones (header info is the same, body is replaced with random numbers) using pymatgen.dev_scripts.potcar_scrambler.py
  • All test POTCARs that permit gzipped i/o are now gzipped

Copy link
Member

@janosh janosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great stuff, esp. all the new tests! thanks @esoteric-ephemera! 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe gzip this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not needed for the tests, so I removed it. Think it's worth it to switch out the other POTCARs here for fake ones like in PMG?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think so. maybe not all of them are needed in the 1st place

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done - last thing is to figure out why the pssyevx test fails in CI but passes locally

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temporarily unzipped these so the tests pass. Just seems like the *.gz files aren't being properly found by pytest. Maybe a config thing?

@@ -1046,3 +1065,71 @@ def test_correct(self):
incar = Incar.from_file("INCAR")
assert incar.get("PREC") == "High"
assert incar.get("ENAUG", 0) == incar.get("ENCUT", 2) * 2


class NonConvergingErrorHandlerTest(PymatgenTest):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay! great to finally have test coverage for NonConvergingErrorHandler!

@@ -564,18 +569,24 @@ def correct(self):
else:
actions.append({"dict": "INCAR", "action": {"_set": {"ISYM": 0}}})

if "posmap" in self.errors:
if symprec_errors := self.errors & {"posmap", "pricelv"}:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some fancy code here 👍 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I learned from the best!

@codecov-commenter
Copy link

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (eda62bb) 61.15% compared to head (930c83b) 62.54%.

Files Patch % Lines
custodian/vasp/handlers.py 95.83% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #313      +/-   ##
==========================================
+ Coverage   61.15%   62.54%   +1.38%     
==========================================
  Files          35       35              
  Lines        2994     3006      +12     
==========================================
+ Hits         1831     1880      +49     
+ Misses       1163     1126      -37     

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

Copy link
Member

@janosh janosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah buddy! this repo feels light weight now with all those compressed POTCARs 😄

@janosh janosh added handler Error handler pkg Package tests Test all the things labels Feb 2, 2024
@janosh janosh merged commit 5148246 into materialsproject:master Feb 2, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
handler Error handler pkg Package tests Test all the things
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add test for NonConvergingErrorHandler
3 participants