Skip to content

Commit

Permalink
update docstrings and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
jkanche committed Jun 21, 2024
1 parent c36237a commit f7eba2d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Changelog

## Version 0.2.8
## Version 0.2.10

- Added a numpy vectorized version of finding gaps (tldr: not fast compared to the traditional version). May be needs a better implementation
- Added NCLS based intersection operation (based on what pyranges does in their internals)
- Added tests for intersection operations.

## Version 0.2.8 - 0.2.9

Optimizing a couple of methods in `IRanges`:

Expand Down
17 changes: 16 additions & 1 deletion src/iranges/IRanges.py
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,9 @@ def gaps_numpy(
"""Gaps returns an ``IRanges`` object representing the set of integers that remain after the intervals are
removed specified by the start and end arguments.
This function uses a vectorized approach using numpy vectors.
The normal :py:meth:`~.gaps` method performs better in most cases.
Args:
start:
Restrict start position. Defaults to 1.
Expand Down Expand Up @@ -1705,7 +1708,19 @@ def intersect(self, other: "IRanges") -> "IRanges":
# Inspired by pyranges intersection using NCLS
# https://github.com/pyranges/pyranges/blob/master/pyranges/methods/intersection.py
def intersect_ncls(self, other: "IRanges", delete_index: bool = True) -> "IRanges":
# self._build_ncls_index()
"""Find intersecting intervals with `other`. Uses the NCLS index.
Args:
other:
An `IRanges` object.
Raises:
TypeError:
If ``other`` is not `IRanges`.
Returns:
A new ``IRanges`` object with all intersecting intervals.
"""

other._build_ncls_index()

Expand Down

0 comments on commit f7eba2d

Please sign in to comment.