Skip to content

Commit

Permalink
fixes for python 3.11
Browse files Browse the repository at this point in the history
random.sample() must be given a sequence, which for dict keys means that one must `sorted()` them.
  • Loading branch information
kdm9 authored Jan 8, 2024
1 parent dfc8609 commit 444f3bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion samplot/samplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ def sample_normal(max_depth, pairs, z):
inside_norm[read_name] = pair

if len(inside_norm) > max_depth:
for read_name in random.sample(inside_norm.keys(), max_depth):
for read_name in random.sample(sorted(inside_norm.keys()), max_depth):
sampled_pairs[read_name] = inside_norm[read_name]
else:
for read_name in inside_norm:
Expand Down

0 comments on commit 444f3bd

Please sign in to comment.