From d6bb092967c474c57fe59938debc6c329166925c Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Tue, 4 Jun 2024 16:48:17 -0400 Subject: [PATCH] refactor --- custodian/vasp/handlers.py | 9 ++------- tests/vasp/test_handlers.py | 13 +------------ 2 files changed, 3 insertions(+), 19 deletions(-) diff --git a/custodian/vasp/handlers.py b/custodian/vasp/handlers.py index f96c7a77..9b6a27b5 100644 --- a/custodian/vasp/handlers.py +++ b/custodian/vasp/handlers.py @@ -1343,16 +1343,11 @@ def correct(self, directory="./"): # sigma_new = [E_entropy(new) / E_entropy(current) ]**(0.5) * sigma_current, # Practically, E_entropy(new) = 1 meV/atom if sigma > self.min_sigma: + updated_sigma = max(self.min_sigma, 0.8 * (self.e_entropy_tol / self.entropy_per_atom) ** (0.5) * sigma) actions.append( { "dict": "INCAR", - "action": { - "_set": { - "SIGMA": max( - self.min_sigma, 0.8 * (self.e_entropy_tol / self.entropy_per_atom) ** (0.5) * sigma - ) - } - }, + "action": {"_set": {"SIGMA": updated_sigma}}, } ) elif ismear != 0: diff --git a/tests/vasp/test_handlers.py b/tests/vasp/test_handlers.py index e5d22b03..abcd7807 100644 --- a/tests/vasp/test_handlers.py +++ b/tests/vasp/test_handlers.py @@ -815,18 +815,7 @@ def test_check_with_non_kspacing_wf(self) -> None: class LargeSigmaHandlerTest(PymatgenTest): def setUp(self) -> None: - copy_tmp_files( - self.tmp_path, - *[ - f"large_sigma/{f}" - for f in ( - "INCAR", - "POSCAR", - "OUTCAR_fail_sigma_check.gz", - "OUTCAR_pass_sigma_check.gz", - ) - ], - ) + copy_tmp_files(self.tmp_path, **glob("large_sigma/*", root_dir=TEST_FILES)) def test_check_correct_large_sigma(self) -> None: # first check should reduce sigma