Skip to content

Commit

Permalink
BUG: Python 3.11 requires random.sample(_sequence_, int)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leengit committed Sep 17, 2024
1 parent a69556e commit 8b3bab7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions histomics_stream/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ def __call__(self, slide):
if 0 <= self.randomly_select < len(slide["tiles"]):
# Choose a subset of the tiles randomly
slide["tiles"] = dict(
random.sample(slide["tiles"].items(), self.randomly_select)
random.sample(sorted(slide["tiles"].items()), self.randomly_select)
)

def check_mask_filename(self, mask_filename):
Expand Down Expand Up @@ -806,7 +806,7 @@ def __call__(self, slide):
if 0 <= self.randomly_select < len(slide["tiles"]):
# Choose a subset of the tiles randomly
slide["tiles"] = dict(
random.sample(slide["tiles"].items(), self.randomly_select)
random.sample(sorted(slide["tiles"].items()), self.randomly_select)
)


Expand Down

0 comments on commit 8b3bab7

Please sign in to comment.