Skip to content

Commit

Permalink
random.sample: do not call with a set
Browse files Browse the repository at this point in the history
  • Loading branch information
markotoplak committed Oct 4, 2023
1 parent 50fbe2d commit 5f90ec6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion orangecontrib/spectroscopy/widgets/owspectra.py
Original file line number Diff line number Diff line change
Expand Up @@ -1508,7 +1508,7 @@ def _compute_sample(self, ys):
subset_additional = MAX_INSTANCES_DRAWN - (len(subset) - len(subset_to_show))
if len(subset_to_show) > subset_additional:
subset_to_show = \
random.Random(self.sample_seed).sample(subset_to_show, subset_additional)
random.Random(self.sample_seed).sample(sorted(subset_to_show), subset_additional)
sampled_indices = sorted(sample_selection + list(subset_to_show))
else:
sampled_indices = list(range(len(ys)))
Expand Down

0 comments on commit 5f90ec6

Please sign in to comment.