Skip to content

Commit

Permalink
titer_model: Fix error when subsampling strains
Browse files Browse the repository at this point in the history
Fixes a type error "Population must be a sequence.  For dicts or sets,
use sorted(d)."
  • Loading branch information
huddlej committed Dec 21, 2024
1 parent 3a6df05 commit fefdec7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion augur/titer_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ def make_training_set(self, training_fraction=1.0, subset_strains=False, **kwarg
from random import sample
tmp = set(self.test_strains)
tmp.difference_update(self.ref_strains) # don't use references viruses in the set to sample from
training_strains = sample(tmp, int(training_fraction*len(tmp)))
training_strains = sample(sorted(tmp), int(training_fraction*len(tmp)))
for tmpstrain in self.ref_strains: # add all reference viruses to the training set
if tmpstrain not in training_strains:
training_strains.append(tmpstrain)
Expand Down

0 comments on commit fefdec7

Please sign in to comment.