Open rikigigi opened 5 days ago
@aiida_workgraph.task.calcfunction(outputs=[{'name': 'start_structure','identifier':aiida.orm.StructureData},{'name': 'start_velocities_A_au'}]) def get_structure_and_velocities(trajectory_or_structure : aiida.orm.TrajectoryData|aiida.orm.StructureData): outputs={ 'start_structure':trajectory_or_structure.get_step_structure(trajectory_or_structure.numsteps-1) if isinstance(trajectory_or_structure,aiida.orm.TrajectoryData) else trajectory_or_structure, 'start_velocities_A_au':trajectory_or_structure.get_step_data(trajectory_or_structure.numsteps -1)['velocities'] if isinstance(trajectory_or_structure,aiida.orm.TrajectoryData) and 'velocities' in trajectory_or_structure.get_arraynames() else None } # other lines omitted [....] struct_velocities = wg.add_task(get_structure_and_velocities, name=f'get_structure_and_velocities_{name}', trajectory_or_structure=link_from.outputs['output_trajectory']) print(struct_velocities.outputs['start_structure'].identifier)
the identifier of the output type aiida.orm.StructureData is not workgraph.aiida_structuredata but StructureData
aiida.orm.StructureData
workgraph.aiida_structuredata
StructureData
the solution is to manually specify workgraph.aiida_structuredata as identifier, but this should be handled automatically
using last git main
the identifier of the output type
aiida.orm.StructureData
is notworkgraph.aiida_structuredata
butStructureData
the solution is to manually specify workgraph.aiida_structuredata as identifier, but this should be handled automatically
using last git main