Shared string ranker - #39
Merged
Merged
Conversation
`ruranges.numpy.nearest(..., ties="first")` reports one neighbour per distance instead of every neighbour at that distance, binding `ruranges_core::nearest::nearest_with_ties`. The default, `"all"`, is what nearest has always done, and the kernel builds the same output for it as before. With `include_overlaps=True` every interval a query overlaps sits at distance 0, so "all tied neighbours" is "every overlapping interval": on 100 million hg38-like intervals that is 1.1 billion rows against 7.7 million for one per query. The tied rows are never built, so the saving is in memory as well as time. `ties` is parsed in the binding rather than in the kernel's `FromStr`, which panics. A PanicException is not an Exception, so `except Exception` cannot catch it and the interpreter is aborted -- the same trap `direction` fell into and pyranges1 had to guard against. Requires ruranges-core 0.1.13, patched to the adjacent checkout until it is published. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
nearest takes ties="first"
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.
No description provided.