-
Notifications
You must be signed in to change notification settings - Fork 876
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
Update vasprun.converged_ionic
logic when EDIFFG=0
#3765
Update vasprun.converged_ionic
logic when EDIFFG=0
#3765
Conversation
… where users set EDIFFG to 0
Important Auto Review SkippedReview was skipped due to path filters Files ignored due to path filters (1)
You can disable this status message by setting the WalkthroughThe recent updates in the pymatgen library refine the logic for determining the convergence of ionic steps in VASP simulations. These changes incorporate handling Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
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.
Actionable comments posted: 1
pymatgen/io/vasp/outputs.py
Outdated
In case where EDIFFG=0, return True if the max ionic steps are reached. | ||
""" | ||
nsw = self.parameters.get("NSW", 0) | ||
ediffg = self.parameters.get("EDIFFG", 1) | ||
ibrion = self.parameters.get("IBRION", -1 if nsw in (-1, 0) else 0) | ||
if ibrion == 0: | ||
return nsw <= 1 or self.md_n_steps == nsw | ||
if ibrion in [1,2] and ediffg == 0: | ||
return nsw <= 1 or nsw == len(self.ionic_steps) |
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.
Refine the logic for handling EDIFFG=0
in converged_ionic
method.
- if ibrion in [1,2] and ediffg == 0:
- return nsw <= 1 or nsw == len(self.ionic_steps)
+ if ibrion in [1, 2]:
+ if ediffg == 0:
+ return nsw <= 1 or nsw == len(self.ionic_steps)
+ else:
+ return nsw <= 1 or len(self.ionic_steps) < nsw
This change ensures that the method handles cases where EDIFFG
is not zero correctly, separating the logic for EDIFFG=0
and other values more clearly.
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation.
In case where EDIFFG=0, return True if the max ionic steps are reached. | |
""" | |
nsw = self.parameters.get("NSW", 0) | |
ediffg = self.parameters.get("EDIFFG", 1) | |
ibrion = self.parameters.get("IBRION", -1 if nsw in (-1, 0) else 0) | |
if ibrion == 0: | |
return nsw <= 1 or self.md_n_steps == nsw | |
if ibrion in [1,2] and ediffg == 0: | |
return nsw <= 1 or nsw == len(self.ionic_steps) | |
In case where EDIFFG=0, return True if the max ionic steps are reached. | |
""" | |
nsw = self.parameters.get("NSW", 0) | |
ediffg = self.parameters.get("EDIFFG", 1) | |
ibrion = self.parameters.get("IBRION", -1 if nsw in (-1, 0) else 0) | |
if ibrion == 0: | |
return nsw <= 1 or self.md_n_steps == nsw | |
if ibrion in [1, 2]: | |
if ediffg == 0: | |
return nsw <= 1 or nsw == len(self.ionic_steps) | |
else: | |
return nsw <= 1 or len(self.ionic_steps) < nsw |
d471345
to
799c69f
Compare
@janosh this is ready for merging |
Just for context / documentation: the specific use case for |
Signed-off-by: Matthew Kuner <82329282+matthewkuner@users.noreply.github.com>
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.
thanks @matthewkuner for this change and @esoteric-ephemera for the context! 👍
vasprun.converged_ionic
logic when EDIFFG=0
60e8a98
to
2330adb
Compare
2330adb
to
f1e9297
Compare
something wrong with the new test file it seems. can't be found for unknown reasons |
Also see if file finding will be magically fixed. Praying for this Signed-off-by: Matthew Kuner <82329282+matthewkuner@users.noreply.github.com>
Head branch was pushed to by a user without write access
e10c93d
to
0f05ed2
Compare
closed in favor of #3783 |
(#3783) * init commit * add back type hints accidentally removed * pre-commit auto-fixes * Fix lobster test --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: esoteric-ephemera <aaron.kaplan.physics@gmail.com>
a new test for this has been added as well.
Summary by CodeRabbit
EDIFFG=0
.