Skip to content

Fix #280: distance_to_locus supports ignore_strand for cross-strand distances#336

Merged
iskandr merged 1 commit into
mainfrom
fix-280-distance-to-locus-ignore-strand
May 12, 2026
Merged

Fix #280: distance_to_locus supports ignore_strand for cross-strand distances#336
iskandr merged 1 commit into
mainfrom
fix-280-distance-to-locus-ignore-strand

Conversation

@iskandr

@iskandr iskandr commented May 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds an ignore_strand=False keyword to Locus.distance_to_locus so callers can opt into a strand-invariant distance instead of getting inf when two loci are on opposite strands of the same contig.
  • Default behavior is unchanged: inf for different contigs, and inf for opposite strands unless the caller opts in.
  • Bumps version to 2.6.10.

Closes #280.

Test plan

  • pytest tests/test_locus.py
  • ./lint.sh
  • CI on PR

…istances

Previously distance_to_locus always returned inf for loci on opposite
strands of the same contig. The default behavior is preserved; passing
ignore_strand=True now yields a strand-invariant distance.

Bump version to 2.6.10.
@iskandr iskandr merged commit 31323f0 into main May 12, 2026
10 checks passed
@iskandr iskandr deleted the fix-280-distance-to-locus-ignore-strand branch May 12, 2026 02:58
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 83.652% (+0.01%) from 83.642% — fix-280-distance-to-locus-ignore-strand into main

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.

distance_to_locus is inf for loci on opposite strands, feature or a bug?

2 participants