Skip to content

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

Open
@SergeevGregory

Description

@SergeevGregory

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions