From 1466d2229179565c275a0a78e9009d3d248f05d0 Mon Sep 17 00:00:00 2001 From: "Andrew S. Rosen" Date: Sun, 14 Dec 2025 11:16:44 -0500 Subject: [PATCH] Remove unused `copy_contcar_to_poscar_if_valid` function In #416, after the rebase, a utility function `copy_contcar_to_poscar_if_valid` was added. But it is unused. We should remove the unused code. --- src/custodian/vasp/utils.py | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/src/custodian/vasp/utils.py b/src/custodian/vasp/utils.py index 27c6ac5d..7687a952 100644 --- a/src/custodian/vasp/utils.py +++ b/src/custodian/vasp/utils.py @@ -142,21 +142,3 @@ def is_valid_poscar(filename: str, directory: str = "./") -> bool: except Exception as exc: logger.warning(f"{filename} could not be parsed: {exc}") return False - - -def copy_contcar_to_poscar_if_valid(directory: str = "./") -> list[dict]: - """Return action to copy CONTCAR to POSCAR only if CONTCAR is valid. - - This prevents copying incomplete CONTCAR files that may result from - terminating VASP mid-write. - - Args: - directory: Directory containing CONTCAR - - Returns: - List containing the copy action if CONTCAR is valid, empty list otherwise. - """ - if is_valid_poscar("CONTCAR", directory): - return [{"file": "CONTCAR", "action": {"_file_copy": {"dest": "POSCAR"}}}] - logger.warning("CONTCAR is not valid, skipping copy to POSCAR") - return []