Skip to content

the identifier of the output type aiida.orm.StructureData is not 'workgraph.aiida_structuredata but StructureData` #355

Open
@rikigigi

Description

@rikigigi
@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

the solution is to manually specify workgraph.aiida_structuredata as identifier, but this should be handled automatically

using last git main

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions