Skip to content

Commit

Permalink
Merge pull request #389 from ISISNeutronMuon/chi/group-level-configur…
Browse files Browse the repository at this point in the history
…ator-fix

Group level configurator fix
  • Loading branch information
MBartkowiakSTFC authored Mar 25, 2024
2 parents dc6dc0d + 775220a commit f6de82b
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,15 @@ def configure(self, value):
trajConfig = self._configurable[self._dependencies["trajectory"]]
atomSelectionConfig = self._configurable[self._dependencies["atom_selection"]]

allAtoms = sorted_atoms(trajConfig["chemical_system"].atom_list)
allAtoms = sorted_atoms(trajConfig["instance"].chemical_system.atom_list)

groups = collections.OrderedDict()
for i in range(atomSelectionConfig["selection_length"]):
idx = atomSelectionConfig["indexes"][i][0]
el = atomSelectionConfig["elements"][i][0]
mass = atomSelectionConfig["masses"][i][0]
at = allAtoms[idx]
lvl = LEVELS[value][
at.top_level_chemical_entity().__class__.__name__.lower()
]
lvl = LEVELS[value][at.top_level_chemical_entity.__class__.__name__.lower()]
parent = self.find_parent(at, lvl)
d = groups.setdefault(parent, {})
d.setdefault("indexes", []).append(idx)
Expand Down

0 comments on commit f6de82b

Please sign in to comment.