Skip to content

Commit

Permalink
When more than 2 molecules are used with TIES, the tried strategies a…
Browse files Browse the repository at this point in the history
…re breaking down. Specifically, some of them have no suggestions, meaning that no pairs are removed even though the net q has not been reached.
  • Loading branch information
bieniekmateusz committed Oct 27, 2024
1 parent 4987266 commit eff7027
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ties/topology_superimposer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1394,11 +1394,13 @@ def _smart_netqtol_pair_picker(self, strategy):
diff_sorted = self._sort_pairs_into_categories_qnettol(diff_q_pairs, best_cases_num=len(self))

# for other strategies, take the key directly, but only if there is one
if diff_sorted[strategy]:
if strategy in diff_sorted:
pairs_in_category = diff_sorted[strategy]
else:

if strategy not in diff_sorted or len(pairs_in_category) == 0:
# if there is no option in that category, revert to greedy
pairs_in_category = diff_sorted['greedy']

return pairs_in_category[0]

def _sort_pairs_into_categories_qnettol(self, pairs, best_cases_num=6):
Expand Down

0 comments on commit eff7027

Please sign in to comment.