Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use random seed before shuffle #896

Merged
merged 1 commit into from
Mar 27, 2024
Merged

Conversation

BeritJanssen
Copy link
Collaborator

Address problem for Congo-MatchingPairs that the board used for the practice sessions should be fixed, but not too predictable.

@Evert-R Evert-R merged commit 7a858fa into develop Mar 27, 2024
10 of 11 checks passed
@Evert-R Evert-R deleted the feature/shuffle-fixed-board branch March 27, 2024 06:21
@drikusroor
Copy link
Contributor

Would be nice if there had been a test that runs that randomisation method a couple of times to see if it stays in the same random order

if self.randomize:
random.shuffle(pairs)
random.seed(self.random_seed)
random.shuffle(pairs)
selected_pairs = pairs[:self.num_pairs]
originals = session.playlist.section_set.filter(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this actually going to work? There is randomisation going on, but then you do a query from the database with a filter on the selected pairs. Won't that just return the sections in the order as returned from the database?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants