Skip to content

Commit

Permalink
Structure_classes tuple instead of explicit tuple of types
Browse files Browse the repository at this point in the history
for output structure of pw calcjob.
  • Loading branch information
mikibonacci committed Dec 5, 2024
1 parent 1dfd4ed commit 94b6d88
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
# -*- coding: utf-8 -*-
"""Calcfunction to primitivize a structure and return high symmetry k-point path through its Brillouin zone."""
from aiida.common import exceptions
from aiida.engine import calcfunction
from aiida.orm import Data
from aiida.plugins import DataFactory

from aiida_quantumespresso.data.hubbard_structure import HubbardStructureData

try:
StructureData = DataFactory('atomistic.structure')
HAS_ATOMISTIC = True
except exceptions.MissingEntryPointError:
HAS_ATOMISTIC = False


@calcfunction
def seekpath_structure_analysis(structure, **kwargs):
Expand Down Expand Up @@ -32,7 +40,10 @@ def seekpath_structure_analysis(structure, **kwargs):

result = get_explicit_kpoints_path(structure, **unwrapped_kwargs)

if isinstance(structure, HubbardStructureData):
if HAS_ATOMISTIC:
if isinstance(structure, StructureData):
raise NotImplementedError('This function does not yet support the conversion into atomistic instances.')
elif isinstance(structure, HubbardStructureData):
result['primitive_structure'] = update_structure_with_hubbard(result['primitive_structure'], structure)
result['conv_structure'] = update_structure_with_hubbard(result['conv_structure'], structure)

Expand Down
2 changes: 1 addition & 1 deletion src/aiida_quantumespresso/calculations/pw.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def define(cls, spec):

spec.output('output_parameters', valid_type=orm.Dict,
help='The `output_parameters` output node of the successful calculation.')
spec.output('output_structure', valid_type=(StructureData, LegacyStructureData), required=False,
spec.output('output_structure', valid_type=structures_classes, required=False,
help='The `output_structure` output node of the successful calculation if present.')
spec.output('output_trajectory', valid_type=orm.TrajectoryData, required=False)
spec.output('output_band', valid_type=orm.BandsData, required=False,
Expand Down

0 comments on commit 94b6d88

Please sign in to comment.