- Added:
merge_overlaps()
method and testsmerge_equals()
method and testsrange()
methodspan()
method, for returning the difference betweenend()
andbegin()
- Fixes:
- Development version numbering is changing to be compliant with PEP440. Version numbering now contains major, minor and micro release numbers, plus the number of builds following the stable release version, e.g. 2.0.4b34
- Speed improvement:
begin()
andend()
methods used iterativemin()
andmax()
builtins instead of the more efficientiloc
member available toSortedDict
overlaps()
method used to returnTrue
even if provided null test interval
- Maintainers:
- Added coverage test (
make coverage
) with html report (htmlcov/index.html
) - Tests run slightly faster
- Added coverage test (
- Fix: Issue #27: README incorrectly showed using a comma instead of a colon when querying the
IntervalTree
: it showedtree[begin, end]
instead oftree[begin:end]
- Fix: README showed using + operator for setlike union instead of the correct | operator
- Removed tests from release package to speed up installation; to get the tests, download from GitHub
- Fix: Issue #20: performance enhancement for large trees.
IntervalTree.search()
made a copy of the entireboundary_table
resulting in linear search time. Thesortedcollections
package is now the sole install dependency
- Fix: Issue #26: failed to prune empty
Node
after a rotation promoted contents ofs_center
IntervalTree
now supports the fullcollections.MutableSet
API- Added:
__delitem__
toIntervalTree
Interval
comparison methodslt()
,gt()
,le()
andge()
toInterval
, as an alternative to the comparison operators, which are designed for sortingIntervalTree.from_tuples(iterable)
IntervalTree.clear()
IntervalTree.difference(iterable)
IntervalTree.difference_update(iterable)
IntervalTree.union(iterable)
IntervalTree.intersection(iterable)
IntervalTree.intersection_update(iterable)
IntervalTree.symmetric_difference(iterable)
IntervalTree.symmetric_difference_update(iterable)
IntervalTree.chop(a, b)
IntervalTree.slice(point)
- Deprecated
IntervalTree.extend()
-- useupdate()
instead - Internal improvements:
- More verbose tests with progress bars
- More tests for comparison and sorting behavior
- Code in the README is included in the unit tests
- Fixes
- BACKWARD INCOMPATIBLE: On ranged queries where
begin >= end
, the query operated on the overlaps ofbegin
. This behavior was documented as expected in 1.x; it is now changed to be more consistent with the definition ofInterval
s, which are half-open. - Issue #25: pruning empty Nodes with staggered descendants could result in invalid trees
- Sorting
Interval
s and numbers in the same list gathered all the numbers at the beginning and theInterval
s at the end IntervalTree.overlaps()
and friends returnedNone
instead ofFalse
- Maintainers:
make install-testpypi
failed because thepip
was missing a--pre
flag
- BACKWARD INCOMPATIBLE: On ranged queries where
- Removed requirement for pyandoc in order to run functionality tests.
- Added ability to use
Interval.distance_to()
with points, not justIntervals
- Added documentation on return types to
IntervalTree
andInterval
Interval.__cmp__()
works with points too- Fix:
IntervalTree.score()
returned maximum score of 0.5 instead of 1.0. Now returns max of subscores instead of avg - Internal improvements:
- Development version numbering scheme, based on
git describe
the "building towards" release is appended after a hyphen, eg. 1.0.2-37-g2da2ef0-1.10. The previous tagged release is 1.0.2, and there have been 37 commits since then, current tag is g2da2ef0, and we are getting ready for a 1.1.0 release - Optimality tests added
Interval
overlap tests for ranges,Interval
s and points added
- Development version numbering scheme, based on
-Bug fixes:
- Node.depth_score_helper()
raised AttributeError
- README formatting
- Fix: pip install failure because of failure to generate README.rst
- Renamed from PyIntervalTree to intervaltree
- Speed improvements for adding and removing Intervals (~70% faster than 0.4)
- Bug fixes:
- BACKWARD INCOMPATIBLE:
len()
of anInterval
is always 3, reverting to default behavior fornamedtuples
. In Python 3,len
returning a non-integer raises an exception. Instead, useInterval.length()
, which returns 0 for null intervals andend - begin
otherwise. Also, if thelen() === 0
, thennot iv
isTrue
. - When inserting an
Interval
via__setitem__
and improper parameters given, all errors were transformed toIndexError
split_overlaps
did not update theboundary_table
counts
- BACKWARD INCOMPATIBLE:
- Internal improvements:
- More robust local testing tools
- Long series of interdependent tests have been separated into sections
- Faster balancing (~80% faster)
- Bug fixes:
- Double rotations were performed in place of a single rotation when presented an unbalanced Node with a balanced child.
- During single rotation, kept referencing an unrotated Node instead of the new, rotated one
- Made IntervalTree crash if inited with a null Interval (end <= begin)
- IntervalTree raises ValueError instead of AssertionError when a null Interval is inserted
- Support for Python 3.2+ and 2.6+
- Changed license from LGPL to more permissive Apache license
- Merged changes from https://github.com/konstantint/PyIntervalTree to
https://github.com/chaimleib/PyIntervalTree
- Interval now inherits from a namedtuple. Benefits: should be faster. Drawbacks: slight behavioural change (Intervals not mutable anymore).
- Added float tests
- Use setup.py for tests
- Automatic testing via travis-ci
- Removed dependency on six
- Interval improvements:
- Intervals without data have a cleaner string representation
- Intervals without data are pickled more compactly
- Better hashing
- Intervals are ordered by begin, then end, then by data. If data is not orderable, sorts by type(data)
- Bug fixes:
- Fixed crash when querying empty tree
- Fixed missing close parenthesis in examples
- Made IntervalTree crash earlier if a null Interval is added
- Internals:
- New test directory
- Nicer display of data structures for debugging, using custom test/pprint.py (Python 2.6, 2.7)
- More sensitive exception handling
- Local script to test in all supported versions of Python
- Added IntervalTree.score() to measure how optimally a tree is structured
- Slight changes for inclusion in PyPI.
- Some documentation changes
- Added tests
- Bug fix: interval addition via [] was broken in Python 2.7 (see http://bugs.python.org/issue21785)
- Added intervaltree.bio subpackage, adding some utilities for use in bioinformatics
- Forked from https://github.com/MusashiAharon/PyIntervalTree