Repository navigation
Conversation
window_statistic only merged the last chunk when it was shorter than the longest window, so a long window elsewhere (common with window_by_position) made map_overlap rechunk and the windows-per-chunk no longer matched. Fixes sgkit-dev#1343
Mohit-Ak
marked this pull request as ready for review
November 3, 2026 03:40
This branch has not been deployed
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.
Problem
window_statisticonly merged the last chunk when it was shorter than the longest window. Withwindow_by_positiona window can easily span more variants than a middle chunk.map_overlapthen rechunks the input silently, thewindows_per_chunkpassed as output chunks no longer matches, anddivergence/Fstfail withValueError: Dimension 0 has N blocks, adjust_chunks specified with M blocks.Change
Before calling
map_overlap, merge consecutive chunks so that each one is at least as long as the longest window. The old last-chunk special case was one instance of this.Testing
test_window_statistic__window_longer_than_chunk(3 chunk layouts): fails onmainwith the error from the issue and passes with the fix.window_by_position→divergence→Fst) on chunked simulated data now matches the unchunked result.pytest sgkit/tests: 1337 passed. black/isort/flake8 at the pre-commit versions are clean.Fixes #1343