Skip to content

Commit

Permalink
[contacts.ContactGroup.repframes] bugfix: properly join geometries if…
Browse files Browse the repository at this point in the history
… they're accessible as md.Trajectories
  • Loading branch information
gph82 committed Sep 5, 2024
1 parent a41cc34 commit 754acbe
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions mdciao/contacts/contacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -6396,14 +6396,15 @@ def repframes(self, scheme="mode",
print("Returning frame %u of traj nr. %u: %s"%(frame_idx, traj_idx, reptraj))
if isinstance(reptraj, str):
if _path.exists(reptraj):
if len(geoms) == 0:
geoms = _md.load(reptraj, top=self.top,frame=frame_idx)
else:
geoms = geoms.join(_md.load(reptraj, top=self.top, frame=frame_idx))
geom = _md.load(reptraj, top=self.top,frame=frame_idx)
else:
raise FileNotFoundError(f"The file '{reptraj}' can't be found anymore. Is this an `mdciao.examples` object?")
else:
geoms.append(reptraj[frame_idx])
geom = reptraj[frame_idx]
if len(geoms)==0:
geoms = geom
else:
geoms = geoms.join(geom)
return_tuple = tuple([*return_tuple, geoms])
return return_tuple

Expand Down

0 comments on commit 754acbe

Please sign in to comment.