# -*- coding: utf-8 -*-
###########################################################################
# Copyright (c), The AiiDA team. All rights reserved. #
# This file is part of the AiiDA code. #
# #
# The code is hosted on GitHub at https://github.com/aiidateam/aiida-core #
# For further information on the license, see the LICENSE.txt file #
# For further information please visit http://www.aiida.net #
###########################################################################
"""Tools to operate on `TrajectoryData` nodes."""
from aiida.engine import calcfunction
[docs]@calcfunction
def _get_aiida_structure_inline(trajectory, parameters):
"""
Creates :py:class:`aiida.orm.nodes.data.structure.StructureData` using ASE.
.. note:: requires ASE module.
"""
kwargs = {}
if parameters is not None:
kwargs = parameters.get_dict()
if 'index' not in kwargs.keys() or kwargs['index'] is None:
raise ValueError('Step index is not supplied for TrajectoryData')
return {'structure': trajectory.get_step_structure(**kwargs)}