Skip to content

Commit

Permalink
- Fix error in breaking the function
Browse files Browse the repository at this point in the history
  • Loading branch information
PardhavMaradani committed Feb 23, 2025
1 parent 1b6781f commit cff7e20
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions molecularnodes/entities/trajectory/selections.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,18 @@ def __init__(self, trajectory, name: str = "selection_0"):
self._name = name
self._current_selection_str: str = ""
self.trajectory = trajectory
self.trajectory.object.mn_trajectory_selections.add()
self.trajectory.object.mn_trajectory_selections[-1].name = self.name
self.trajectory.object.mn_trajectory_selections[-1].uuid = self._uuid
self.updating = updating
self.periodic = periodic
self.set_atom_group(selection_str)
self.selection_str = selection_str
self.mask_array = self._ag_to_mask()

def add_selection_property(
self, selection_str: str = "all", updating=True, periodic=True
):
prop = self.trajectory.object.mn_trajectory_selections.add()
prop.name = self.name
prop.uuid = self._uuid
self.updating = updating
self.periodic = periodic
self.set_atom_group(selection_str)
self.selection_str = selection_str
self.mask_array = self._ag_to_mask()

@property
def name(self) -> str:
Expand Down

0 comments on commit cff7e20

Please sign in to comment.