Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
hainm committed Nov 22, 2024
1 parent 660af04 commit fbdd325
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
9 changes: 7 additions & 2 deletions nglview/tests/test_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,14 @@


def get_mocked_traj():
class MockedTraj(nv.Structure):
class MockedTraj(nv.Structure, nv.Trajectory):
def __init__(self):
self.n_frames = 10
nv.Structure.__init__(self)
nv.Trajectory.__init__(self)

@property
def n_frames(self):
return 10

def get_coordinates(self, frame):
return np.random.rand(10, 3, 3)
Expand Down
2 changes: 1 addition & 1 deletion nglview/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@ def set_coordinates(self, arr_dict, movie_making=False,
def _on_frame_changed(self, change):
"""set and send coordinates at current frame
"""
self._set_coordinates(self.frame)
self._set_coordinates(change['new'])

def clear(self, *args, **kwargs):
'''shortcut of `clear_representations`
Expand Down

0 comments on commit fbdd325

Please sign in to comment.