Skip to content

Commit 4c1f1b0

Browse files
committed
Removed unnecessary methods num_timesteps and num_trajectories
1 parent f34ea22 commit 4c1f1b0

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

trajan/traj.py

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,23 +64,17 @@ def __init__(self, ds, obsdim, timedim):
6464
self.obsdim = obsdim
6565
self.timedim = timedim
6666

67-
def num_timesteps(self):
67+
def __repr__(self):
68+
output = '=======================\n'
69+
output += 'TrajAn info:\n'
70+
output += '------------\n'
71+
output += f'{self.ds.sizes["trajectory"]} trajectories\n'
6872
if self.timedim in self.ds.sizes:
6973
timedim = self.timedim
7074
else:
7175
logger.warning(f'self.timedim ({self.timedim}) is not an existing dimension! Using instead "obs".')
7276
timedim = 'obs'
73-
return self.ds.sizes[timedim]
74-
75-
def num_trajectories(self):
76-
return self.ds.sizes['trajectory']
77-
78-
def __repr__(self):
79-
output = '=======================\n'
80-
output += 'TrajAn info:\n'
81-
output += '------------\n'
82-
output += f'{self.num_trajectories()} trajectories\n'
83-
output += f'{self.num_timesteps()} timesteps\n'
77+
output += f'{self.ds.sizes[timedim]} timesteps\n'
8478
try:
8579
timestep = self.timestep()
8680
timestep = timedelta(seconds=int(timestep))

0 commit comments

Comments
 (0)