Skip to content

Commit

Permalink
Small bugfix and changing order if_else in set_cell_from_structure
Browse files Browse the repository at this point in the history
  • Loading branch information
mikibonacci committed Nov 29, 2024
1 parent f44eddf commit 81eeb08
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/aiida/orm/nodes/data/array/kpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 81eeb08

Please sign in to comment.