Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #363.
windowed_count([1, 2, 3, 4], size=1)currently returns windows[1, 1],[2, 2],[3, 4]with counts[1, 1, 2]. The final window can exceed the requested size, which also changes diversity/divergence denominators. A region containing one position raises an indexing error.Use
start + size - 1for the inclusive right endpoint, and include a window beginning at the requested stop. Normalize NumPy integer scalars before inclusive arithmetic to avoid overflow at their dtype limits. Clip and stop at the first window that reaches that endpoint, preserving the existing overlapping-window stopping convention. Twenty tests cover these boundaries, integer limits, gaps and accessibility masks; four existing expectations are updated for the separate terminal window.An independent simulated-cohort replay writes and reads a VCF containing 128 haplotypes and 2,024 variant sites. Physical windows and diversity agree with explicit base enumeration and tskit's C engine in all 72 workflows, versus 50 incorrect or failing workflows before. All 22 previously passing records and the explicit-window controls remain identical.
Full suites pass 901 tests versus 881 on unchanged master, on Python 3.12/NumPy 1.26 and Python 3.10/NumPy 2.2. Correctness Flake8 passes. These runs use Pandas 2.3 and native tabix; Pandas 3 has separate baseline string-dtype test failures.
The installed Python 3.12 wheel also reproduces all 72 workflows exactly, with its imported code and native extension paths checked.