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 random.sample call to be compatible with python 3.12 #273

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

JeanMainguy
Copy link
Member

This PR fixes an issue in the partition module where the random.sample function caused an error in Python versions 3.11 and 3.12, as reported in issue #268.

While PR #255 added support for Python 3.12, this specific issue has been missed. The random.sample function is only called when the number of genomes exceeds the chunk size, which defaults to 500. Since the CI tests run with only 50 genomes, this bug wasn't detected.

To verify the fix, you can run the partition command with a chunk size smaller than the number of genomes:

cd testingDataset
ppanggolin annotate --fasta genomes.fasta.list --output stepbystep --cpu 12
ppanggolin cluster -p stepbystep/pangenome.h5 --cpu 12
ppanggolin graph -p stepbystep/pangenome.h5
ppanggolin partition --output stepbystep -f -p stepbystep/pangenome.h5 --cpu 12 --chunk_size 40

@jpjarnoux jpjarnoux merged commit a9a982e into dev Sep 9, 2024
4 checks passed
@revinici
Copy link

Any ETA on when this fix will be reflected in bioconda?

@JeanMainguy
Copy link
Member Author

This should be released next week. The release is generally available in bioconda a day after the github release..

@axbazin axbazin deleted the support_py3.12 branch October 29, 2024 16:35
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