From abbd3b3488b498c346b2c28896dba6c9afd28e23 Mon Sep 17 00:00:00 2001 From: Sudarshan Vijay Date: Fri, 19 Apr 2024 17:05:30 +0200 Subject: [PATCH] modify tests for OSZICAR --- tests/calculation/test_oszicar.py | 4 ++-- tests/conftest.py | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/calculation/test_oszicar.py b/tests/calculation/test_oszicar.py index 02a35fd8..f2557a75 100644 --- a/tests/calculation/test_oszicar.py +++ b/tests/calculation/test_oszicar.py @@ -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)): @@ -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 diff --git a/tests/conftest.py b/tests/conftest.py index dd8bd451..5f8d7776 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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():