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.
This issue is from a Codex global scan of the repository.
ABACUS Gamma post-processing uses a misspelled attribute and fails when
add_fixis enabled.Evidence:
dpgen/dpgen/auto_test/Gamma.py
Lines 370 to 373 in 7af5246
dpgen/dpgen/auto_test/Gamma.py
Lines 405 to 416 in 7af5246
post_process()checksself.add_fixand dispatches ABACUS tasks to__stru_fix(), but__stru_fix()readsself.addfixwithout the underscore. That attribute is not defined by the surrounding code, so ABACUS Gamma tasks with fixed directions raiseAttributeErrorbefore callingabacus.stru_fix_atom().Expected behavior:
__stru_fix()should use the sameself.add_fixattribute used by the VASP and LAMMPS fix paths.