Skip to content

Commit

Permalink
Fix compartment ordering randomization due to use of set (#799)
Browse files Browse the repository at this point in the history
Get rid of all things set()

This solves the issue whereby sometimes in examination with multiple datasets the compartment ordering would be randomized.
  • Loading branch information
jsnel committed Sep 16, 2021
1 parent 5ea9385 commit 90b9ce7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions glotaran/analysis/problem_grouped.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,12 @@ def calculate_index_independent_matrices(
self._reduced_matrices[group_label] = combine_matrices(
[self._reduced_matrices[label] for label in group]
)
self._group_clp_labels[group_label] = list(
set(itertools.chain(*(self._matrices[label].clp_labels for label in group)))
)
group_clp_labels = []
for label in group:
for clp_label in self._matrices[label].clp_labels:
if clp_label not in group_clp_labels:
group_clp_labels.append(clp_label)
self._group_clp_labels[group_label] = group_clp_labels

return self._matrices, self._reduced_matrices

Expand Down

0 comments on commit 90b9ce7

Please sign in to comment.