Skip to content

[Code scan] Fix ABACUS Gamma add_fix attribute typo #1900

Description

@njzjz

This issue is from a Codex global scan of the repository.

ABACUS Gamma post-processing uses a misspelled attribute and fails when add_fix is enabled.

Evidence:

def __stru_fix(self, stru) -> None:
fix_dict = {"true": True, "false": False}
fix_xyz = [fix_dict[i] for i in self.addfix]
abacus.stru_fix_atom(stru, fix_atom=fix_xyz)

def post_process(self, task_list):
if self.add_fix:
count = 0
for ii in task_list:
count += 1
inter = os.path.join(ii, "inter.json")
poscar = os.path.join(ii, "POSCAR")
calc_type = loadfn(inter)["type"]
if calc_type == "vasp":
self.__poscar_fix(poscar)
elif calc_type == "abacus":
self.__stru_fix(os.path.join(ii, "STRU"))

post_process() checks self.add_fix and dispatches ABACUS tasks to __stru_fix(), but __stru_fix() reads self.addfix without the underscore. That attribute is not defined by the surrounding code, so ABACUS Gamma tasks with fixed directions raise AttributeError before calling abacus.stru_fix_atom().

Expected behavior: __stru_fix() should use the same self.add_fix attribute used by the VASP and LAMMPS fix paths.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions