Skip to content

Python 3.14/NumPy 2.0+ compatibility fixes#409

Open
YourePrettyGood wants to merge 3 commits into
RacimoLab:mainfrom
YourePrettyGood:main
Open

Python 3.14/NumPy 2.0+ compatibility fixes#409
YourePrettyGood wants to merge 3 commits into
RacimoLab:mainfrom
YourePrettyGood:main

Conversation

@YourePrettyGood

Copy link
Copy Markdown

Fixes as described in #408 generally making dinf compatible with Python 3.14 and NumPy 2.0+, plus a couple usage/documentation fixes. Also included a small fix for subsampling of individuals, as the original code assumed samples from the same population were found in contiguous blocks of columns in the VCF, and never interleaved with each other. Instead, now we store a map from sample ID to CyVcf2 sample index and convert the samples dict into a sample_indices dict, and use subsamples of the resulting lists to extract the appropriate population-specific genotype matrices. The test and example metadata for dinf.get_samples_from_1kgp_metadata() have been updated accordingly to check for interleaved population blocks.

In the process of running the tests, I ended up having to adjust the pytest config as well to account for the deprecation of marking pytest fixtures in 7.4+. I'm no Python guru, so hopefully didn't break anything there.

…etadata parsing for NumPy 2.0+, allowed dinf-plot gan to work when model parameter truths are not provided, removed FeatureCollection dunder attribute assignment to make compatible with Python 3.14, fixed dinf-plot and dinf-tabulate usage names for docs, and adjusted example model scripts to fix skipping chr22 and missing name for named argument of `dinf.get_samples_from_1kgp_metadata()`.
…mes populations are found in contiguous blocks of VCF columns. This relies on the `BagOfVcf.sample_index_map` attribute added in ecc1551
…tures in 7.4+](https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function), and updated test of 1000 Genomes sample metadata parsing to account for interleaved sample blocks.
@mergify

mergify Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

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.

1 participant