diff --git a/src/aiida/orm/nodes/data/array/kpoints.py b/src/aiida/orm/nodes/data/array/kpoints.py index 3cd9757c30..c048d56eb4 100644 --- a/src/aiida/orm/nodes/data/array/kpoints.py +++ b/src/aiida/orm/nodes/data/array/kpoints.py @@ -223,12 +223,15 @@ def set_cell_from_structure(self, structuredata): :param structuredata: an instance of StructureData """ - from aiida.orm.nodes.data.structure import has_atomistic, StructureData as LegacyStructureData - - if has_atomistic(): - structures_classes = (StructureData, LegacyStructureData) + from aiida.orm.nodes.data.structure import StructureData as LegacyStructureData + from aiida.orm.nodes.data.structure import has_atomistic + + if not has_atomistic(): + structures_classes = (LegacyStructureData,) # type: tuple else: - structures_classes = (LegacyStructureData,) + from aiida_atomistic import StructureData # type: ignore[import-untyped] + + structures_classes = (LegacyStructureData, StructureData) if not isinstance(structuredata, structures_classes): raise TypeError(