Skip to content

Commit

Permalink
Merge branch 'main' into python-api
Browse files Browse the repository at this point in the history
  • Loading branch information
BradyAJohnston committed Dec 31, 2024
2 parents 7e5ba88 + 0234acb commit e09ae8a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion molecularnodes/operators/node_add_buttons.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ class MN_OT_Residues_Selection_Custom(Operator):
)

def execute(self, context):
with nodes.DuplicatePrevention():
with databpy.nodes.DuplicatePrevention():
node_residues = nodes.resid_multiple_selection(
node_name="MN_select_res_id_custom",
input_resid_string=self.input_resid_string,
Expand Down
16 changes: 16 additions & 0 deletions tests/test_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,19 @@ def test_op_api_mda(snapshot_custom: NumpySnapshotExtension):

assert not np.allclose(pos_2, traj_op.position)
assert not np.allclose(pos_2, traj_func.position)

def test_op_residues_selection_custom():
topo = str(data_dir / "md_ppr/box.gro")
traj = str(data_dir / "md_ppr/first_5_frames.xtc")

bpy.context.scene.MN_import_md_topology = topo
bpy.context.scene.MN_import_md_trajectory = traj
bpy.context.scene.mn.import_style = "ribbon"

with ObjectTracker() as o:
bpy.ops.mn.import_trajectory()

area = bpy.context.screen.areas[-1]
area.ui_type = 'GeometryNodeTree'
with bpy.context.temp_override(area = area):
bpy.ops.mn.residues_selection_custom('EXEC_DEFAULT')

0 comments on commit e09ae8a

Please sign in to comment.