-
Notifications
You must be signed in to change notification settings - Fork 208
/
Copy pathtrajectory.py
27 lines (23 loc) · 1.19 KB
/
trajectory.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# -*- 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
@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)}