Skip to content

Commit

Permalink
Merge pull request #270 from pyiron/traj
Browse files Browse the repository at this point in the history
Add HasStructure to Trajectory
  • Loading branch information
pmrv committed Jul 2, 2021
2 parents 93876f9 + f1f2891 commit de9042d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pyiron_atomistics/atomistics/job/atomistic.py
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ def __init__(self):
self.set_structure = set_structure


class Trajectory(object):
class Trajectory(HasStructure):
"""
A trajectory instance compatible with the ase.io class
Expand Down Expand Up @@ -741,9 +741,15 @@ def __getitem__(self, item):
# new_structure.arrays['cells'] = new_structure.cell
return new_structure

def _get_structure(self, frame=-1, wrap_atoms=True):
return self[frame]

def __len__(self):
return len(self._positions)

_number_of_structures = __len__



class GenericInput(GenericParameters):
def __init__(self, input_file_name=None, table_name="generic"):
Expand Down

0 comments on commit de9042d

Please sign in to comment.