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

Test monty fix for reverse readline #4068

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

DanielYang59
Copy link
Contributor

@DanielYang59 DanielYang59 commented Sep 15, 2024

Summary

  • Test monty fix for reverse readline, to close Outcar class returns empty magnetization attribute when parsing OUTCAR file on Windows operating system #4033
  • Replace reverse_readline with faster reverse_readfile
  • Enhance unit test for reported Outcar parser (need to test unzipped format):
    def test_init(self):
    outcar = Outcar(f"{VASP_OUT_DIR}/OUTCAR.gz")
    expected_mag = (
    {"d": 0.0, "p": 0.003, "s": 0.002, "tot": 0.005},
    {"d": 0.798, "p": 0.008, "s": 0.007, "tot": 0.813},
    {"d": 0.798, "p": 0.008, "s": 0.007, "tot": 0.813},
    {"d": 0.0, "p": -0.117, "s": 0.005, "tot": -0.112},
    {"d": 0.0, "p": -0.165, "s": 0.004, "tot": -0.162},
    {"d": 0.0, "p": -0.117, "s": 0.005, "tot": -0.112},
    {"d": 0.0, "p": -0.165, "s": 0.004, "tot": -0.162},
    )
    expected_chg = (
    {"p": 0.154, "s": 0.078, "d": 0.0, "tot": 0.232},
    {"p": 0.707, "s": 0.463, "d": 8.316, "tot": 9.486},
    {"p": 0.707, "s": 0.463, "d": 8.316, "tot": 9.486},
    {"p": 3.388, "s": 1.576, "d": 0.0, "tot": 4.964},
    {"p": 3.365, "s": 1.582, "d": 0.0, "tot": 4.947},
    {"p": 3.388, "s": 1.576, "d": 0.0, "tot": 4.964},
    {"p": 3.365, "s": 1.582, "d": 0.0, "tot": 4.947},
    )
    assert outcar.magnetization == approx(expected_mag, abs=1e-5), "Wrong magnetization read from Outcar"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Outcar class returns empty magnetization attribute when parsing OUTCAR file on Windows operating system
1 participant