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

patches in default LORBIT writing #1424

Merged
merged 4 commits into from
May 21, 2024
Merged

Conversation

ligerzero-ai
Copy link
Contributor

LORBIT is not set by default when specifying spin-polarised calculations... This prevents writing of magnetisations to OUTCAR causing confusion;

i.e.
#1060
#1423

@ligerzero-ai ligerzero-ai requested a review from pmrv May 21, 2024 20:35
Copy link
Contributor Author

@ligerzero-ai ligerzero-ai left a comment

Choose a reason for hiding this comment

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

wrong logic before

@coveralls
Copy link

coveralls commented May 21, 2024

Pull Request Test Coverage Report for Build 9181442884

Details

  • 4 of 12 (33.33%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.03%) to 71.025%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pyiron_atomistics/vasp/base.py 4 12 33.33%
Totals Coverage Status
Change from base Build 9158065008: -0.03%
Covered Lines: 10631
Relevant Lines: 14968

💛 - Coveralls

if "LORBIT" not in self.input.incar._dataset["Parameter"]:
# If LORBIT is not set, set it to 10
self.input.incar["LORBIT"] = 10
warnings.warn("We have set LORBIT = 10 to write magmoms to OUTCAR! This is a spin-polarized calculation.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
warnings.warn("We have set LORBIT = 10 to write magmoms to OUTCAR! This is a spin-polarized calculation.")
self.logger.warning("We have set LORBIT = 10 to write magmoms to OUTCAR! This is a spin-polarized calculation.")

Comment on lines 871 to 874
else:
# If LORBIT is set but not in the valid range, set it to 10 and warn
if self.input.incar["LORBIT"] not in [0, 1, 2, 5, 10, 11, 12, 13, 14]:
warnings.warn("Invalid LORBIT tag. We have set LORBIT = 10 to write magmoms to OUTCAR! This is a spin-polarized calculation.")
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
else:
# If LORBIT is set but not in the valid range, set it to 10 and warn
if self.input.incar["LORBIT"] not in [0, 1, 2, 5, 10, 11, 12, 13, 14]:
warnings.warn("Invalid LORBIT tag. We have set LORBIT = 10 to write magmoms to OUTCAR! This is a spin-polarized calculation.")
# If LORBIT is set but not in the valid range, set it to 10 and warn
elif self.input.incar["LORBIT"] not in [0, 1, 2, 5, 10, 11, 12, 13, 14]:
self.logger.warning("Invalid LORBIT tag. We have set LORBIT = 10 to write magmoms to OUTCAR! This is a spin-polarized calculation.")

Copy link
Contributor

@pmrv pmrv left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

@ligerzero-ai ligerzero-ai added the format_black reformat the code using the black standard label May 21, 2024
@ligerzero-ai ligerzero-ai merged commit 0939b3d into main May 21, 2024
24 of 25 checks passed
@ligerzero-ai ligerzero-ai deleted the magmoms_in_OUTCAR_by_default branch May 21, 2024 21:11
@ligerzero-ai ligerzero-ai linked an issue May 21, 2024 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
format_black reformat the code using the black standard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[VASP] final_magmoms not parsed.
4 participants