Skip to content

Commit

Permalink
modify tests for OSZICAR
Browse files Browse the repository at this point in the history
  • Loading branch information
sudarshanv01 committed Apr 19, 2024
1 parent 403c852 commit abbd3b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/calculation/test_oszicar.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def OSZICAR(raw_data):
oszicar.ref.ncg = convergence_data[:, 4]
oszicar.ref.rms = convergence_data[:, 5]
oszicar.ref.rmsc = convergence_data[:, 6]
oszicar.ref.EDIFF = raw_oszicar.EDIFF
oszicar.ref.is_elmin_converged = raw_oszicar.is_elmin_converged == [0.0]
string_rep = "N\t\tE\t\tdE\t\tdeps\t\tncg\trms\t\trms(c)\n"
format_rep = "{0:g}\t{1:0.12E}\t{2:0.6E}\t{3:0.6E}\t{4:g}\t{5:0.3E}\t{6:0.3E}\n"
for idx in range(len(convergence_data)):
Expand Down Expand Up @@ -59,5 +59,5 @@ def test_print(OSZICAR, format_):

def test_is_converged(OSZICAR, Assert):
actual = OSZICAR.is_converged()
expected = OSZICAR.ref.dE[-1] < OSZICAR.ref.EDIFF
expected = OSZICAR.ref.is_elmin_converged
assert actual == expected
8 changes: 6 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,8 +663,12 @@ def _example_OSZICAR():
)
convergence_data = raw.VaspData(convergence_data)
label = raw.VaspData([b"N", b"E", b"dE", b"deps", b"ncg", b"rms", b"rms(c)"])
ediff = 0.5
return raw.OSZICAR(convergence_data=convergence_data, label=label, EDIFF=ediff)
is_elmin_converged = [0.0]
return raw.OSZICAR(
convergence_data=convergence_data,
label=label,
is_elmin_converged=is_elmin_converged,
)


def _Sr2TiO4_CONTCAR():
Expand Down

0 comments on commit abbd3b3

Please sign in to comment.