atomate icon indicating copy to clipboard operation
atomate copied to clipboard

Bug in get_cutoffs function: undefined variable supercell_structure [lattice_dynamics workflow]

Open SergeevGregory opened this issue 9 months ago • 1 comments

There is a bug in the get_cutoffs function (in lattice_dynamics workflow) where the variable supercell_structure is used instead of the function argument structure. This leads to a NameError when the function is executed.

Problem The function is defined as: def get_cutoffs(structure: Structure):

However, inside the function body, it references supercell_structure.species, which is not defined:

row = int(np.around(np.array([s.row for s in supercell_structure.species]).mean(), 0))
...
max_cutoff = estimate_maximum_cutoff(AseAtomsAdaptor.get_atoms(supercell_structure))

This results in the following error at runtime: NameError: name 'supercell_structure' is not defined

Suggested Fix Replace all instances of supercell_structure with structure, which is the correct function argument.

From: supercell_structure.species

To: structure.species

SergeevGregory avatar May 08 '25 07:05 SergeevGregory