Releases: AlexandreDecan/portion
Releases · AlexandreDecan/portion
IntervalDict.combine
IntervalDict
has a .combine
method to merge its keys and values with another IntervalDict
.
Discrete iteration & dict-like data structure
- Discrete iteration on the values of an interval with
iterate
. - Map intervals to data with the dict-like
IntervalDict
structure. - Faster comparisons between arbitrary values and intervals.
- Deprecate
permissive
in.overlaps
in favour ofadjacent
. - Fix
.union
when intervals share a bound, one inclusive and one exclusive (#12). - Fix
.overlaps
when intervals share a lower bound, and one interval is contained within the other one (#13).
Interval bounds & transformations
- Intervals have a
left
,lower
,upper
, andright
attribute that refer to its enclosure. - Intervals have a
replace
method to create new intervals based on the current one. This method accepts both values and functions. - Intervals have an
apply
method to apply a function on the underlying atomic intervals. - Intervals can be compared with single values as well.
I.empty()
returns the same instance to save memory.- Infinities are singleton objects.
- Set
len(I.empty()) = 1
andI.empty()[0] == I.empty().to_atomic()
for consistency.
Import from and export to Python built-in data types.
Import from and export to Python built-in data types (a list of 4-uples) with from_data
and to_data
(#6).
Add support for customized infinity representation in to_string and from_string (#3).
1.6.0 1.6.0 - Fix #3 (support for inf repr/parsing)
Fix #2 - Invalid .overlaps
1.5.4 Fix #2
Fix invalid repr for atomic singleton intervals
1.5.3 Fix invalid repr for singleton intervals
Fix invalid comparisons between AtomicInterval and Interval
1.5.2 Fix invalid comparison (1.5.2)
1.5.1 - Bug fix for empty intervals
Fix #1 - empty intervals now resolve to (I.inf, -I.inf)
1.5.0
1.5.0