Skip to content

Commit

Permalink
Update tests for LargeSigmaHandler
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewkuner authored May 10, 2024
1 parent 477128d commit c8160fb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions tests/vasp/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,22 +816,23 @@ def setUp(self) -> None:
f"large_sigma/{f}"
for f in (
"INCAR",
"vasprun.xml.1",
"vasprun.xml.2",
"POSCAR",
"OUTCAR_should_pass",
"OUTCAR_should_fail_and_has_incomplete_electronic_steps",
)
],
)

def test_check_correct_large_sigma(self) -> None:
# first check should reduce sigma
handler = LargeSigmaHandler(output_vasprun="vasprun.xml.1")
handler = LargeSigmaHandler(output_filename="OUTCAR_should_fail_and_has_incomplete_electronic_steps")
assert handler.check()
dct = handler.correct()
assert dct["errors"] == ["LargeSigma"]
assert Incar.from_file("INCAR")["SIGMA"] == pytest.approx(0.1115, rel=1.0e-3)
assert Incar.from_file("INCAR")["SIGMA"] == pytest.approx(0.05059644, rel=1.0e-3)

# second check should find that sigma is appropriately reduced
handler = LargeSigmaHandler(output_vasprun="vasprun.xml.2")
# second check should find that sigma is correct as-is
handler = LargeSigmaHandler(output_filename="OUTCAR_should_pass")
assert not handler.check()


Expand Down

0 comments on commit c8160fb

Please sign in to comment.