-
Notifications
You must be signed in to change notification settings - Fork 102
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 failing tests from Pydantic v2 migration #558
Conversation
Hi @janosh , |
@hrushikesh-s Ah, that's a bit annoying. We should add |
Try pulling 5fc8ad7 into your branch. |
@validator("atomic_kind_info") | ||
def remove_unnecessary(self, atomic_kind_info): | ||
@field_validator("atomic_kind_info") | ||
def remove_unnecessary(cls, atomic_kind_info): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self
should stay as is.
Also, as per the pydantic documentation, @field_validator cannot be applied to an instance method and can only be applied to a class method. That's why changing the first argument of remove_unnecessary & cleanup_dft from self to cls
we are now down to 10 failed, 125 passed, 2 skipped, 31 warnings
@janosh, I'm getting the following assertion error for
|
Weird that the values are not consistent. Feel free to loosen for now:
|
Changing the assertion criterion from approx(-10.8454, rel=1e-4) to approx(-10.8, abs=0.2)
@janosh , I'm getting the following errors while running
|
@hrushikesh-s Not sure what changed. Maybe @jmmshn has troubleshooting suggestions? |
@janosh, there's one last error that's coming up in
|
Hi @janosh, It looks like there might have been some upstream changes with parsing the net charge of structures from a VASP directory. The code here was just to do a sanity check of the structure charge before things enter the DB. |
Actually, I just remembered. I think the tests still pass with this error message. |
So, do we need to make any changes to deploy.yaml? |
@jmmshn Thanks for digging into this so quickly! Re unusable POTCARs in CI, maybe something to simulate with @hrushikesh-s Thanks a lot for your help here! 👍 I'll merge this PR and take a look at the last error over in #548. |
@hrushikesh-s I don't think so. If CI is actually breaking on this then we will just have to fix the code. I'll mark some time on Wednesday to make sure this all works. |
@janosh, yeah I think I just ignored it because this failed job was passing CI and it's kind of nice to see the fact that the check is working. Either way I should probably:
|
That would be perfect! |
Summary
Checklist
Work-in-progress pull requests are encouraged, but please put [WIP] in the pull request
title.
Before a pull request can be merged, the following items must be checked:
The easiest way to handle this is to run the following in the correct sequence on
your local machine. Start with running black on your new code. This will
automatically reformat your code to PEP8 conventions and removes most issues. Then run
ruff.
Run ruff on your code.
type check your code.
Note that the CI system will run all the above checks. But it will be much more
efficient if you already fix most errors prior to submitting the PR. It is highly
recommended that you use the pre-commit hook provided in the repository. Simply run
pre-commit install
and a check will be run prior to allowing commits.