Skip to content

Commit

Permalink
Add frames property to trajectory objects
Browse files Browse the repository at this point in the history
  • Loading branch information
klarh committed Jul 24, 2019
1 parent 90cf06d commit 6a315c8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion keras_gtar/trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ def __exit__(self, typ, val, trace):
self.close()

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

@property
def frames(self):
(_, frames) = self.traj.framesWithRecordsNamed('weight')
return len(frames)
return frames

def close(self):
self.traj.close()
Expand Down

0 comments on commit 6a315c8

Please sign in to comment.