Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
BradyAJohnston committed Nov 28, 2024
1 parent 6ff0847 commit b2c713c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
5 changes: 1 addition & 4 deletions molecularnodes/entities/trajectory/trajectory.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,7 @@ def save_filepaths_on_object(self) -> None:
)

def _create_object(
self,
style: str = "vdw",
name: str = "NewUniverseObject",
subframes: int = 0,
self, style: str = "vdw", name: str = "NewUniverseObject"
) -> bpy.types.Object:
obj = bpyd.create_object(
name=name,
Expand Down
10 changes: 2 additions & 8 deletions molecularnodes/entities/trajectory/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,15 @@
)


def load(
top,
traj,
name="NewTrajectory",
style="spheres",
subframes: int = 0,
):
def load(top, traj, name="NewTrajectory", style="spheres"):
top = bl.path_resolve(top)
traj = bl.path_resolve(traj)

universe = mda.Universe(top, traj)

traj = Trajectory(universe=universe)

traj.create_object(name=name, style=style, subframes=subframes)
traj.create_object(name=name, style=style)

return traj

Expand Down
1 change: 1 addition & 0 deletions tests/test_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ def test_op_api_mda(snapshot_custom: NumpySnapshotExtension):
assert obj_1.name == name

traj = mn.entities.trajectory.load(topo, traj, name="test", style="ribbon")
traj.subframes = 0
obj_2 = traj.object

for mol in [obj_1, obj_2]:
Expand Down

0 comments on commit b2c713c

Please sign in to comment.