Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rikigigi opened this issue Nov 21, 2024 · 0 comments

Comments

@rikigigi
Copy link
Member

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant