Skip to content

Releases: AlexandreDecan/portion

Faster IntervalDict operations

26 Nov 09:43
Compare
Choose a tag to compare

Much faster get, copy and | operations for IntervalDict.

2.1.3-post1 (soften dependency constraint)

13 Nov 08:12
a02d6fc
Compare
Choose a tag to compare

Soften dependency constraint towards sortedcontainers (#47).

Hotfix for #41

18 Sep 15:54
Compare
Choose a tag to compare

Fixed

  • Empty intervals are contained in all intervals (#41).

Hot fix for #38, #39 and small changes to support #37

16 Sep 12:06
Compare
Choose a tag to compare

Added

  • IntervalDict supports | and |=, the same way dict will do starting from Python 3.9 (#37).

Fixed

  • Fix invalid simplification of 3+ intervals when a closed interval shares the lower bound of an open one (#38).
  • Fix the order in which items are returned from an IntervalDict when a closed interval shares the lower bound of an open one (#39).

Fix regression for IntervalDict

21 Aug 11:52
Compare
Choose a tag to compare

Fix a regression introduced in 2.1.0 for IntervalDict (#36).

IntervalDict views and fixes

09 Aug 08:52
Compare
Choose a tag to compare

Added

  • IntervalDict.as_dict() to export its content to a classical Python dict.

Changed

  • IntervalDict.keys(), values() and items() return view objects instead of lists.

Fixed

  • IntervalDict.popitem() now returns a (key, value) pair instead of an IntervalDict.
  • The documentation of IntervalDict.pop() now correctly states that the value (and not the key)
    is returned.

Bug fix #28

09 May 09:53
Compare
Choose a tag to compare

2.0.1 - Bug fix

15 Mar 09:16
Compare
Choose a tag to compare

Fix invalid representations of non-atomic intervals composed of a singleton (#22).

2.0.0 - Renamed library, large refactoring and improved performance

06 Mar 12:55
Compare
Choose a tag to compare

Added

  • i.empty to check for interval emptiness.
  • i.atomic to check for interval atomicity.
  • An adjacent method to test whether two intervals are adjacent.
  • i.__getitem__ supports slices.
  • Infinities define a hash value.
  • Static method Interval.from_atomic(left, lower, upper, right) to create an interval composed of a single atomic interval (replaces AtomicInterval(left, lower, upper, right)).

Changed

  • (breaking) python-intervals has been renamed portion.
  • (breaking) Many (optional) parameters are converted to keyword-only arguments:
    • for from_string and to_string: bound, disj, sep, left_open, left_closed, right_open, right_closed, pinf and ninf;
    • for from_data and to_data: pinf and ninf;
    • for iterate: base and reverse;
    • for Interval.replace: ignore_inf.
  • (breaking) incr is replaced by step in iterate.
  • (breaking) For consistency with range, the step parameter in iterate is always added even if reverse=True.
  • (breaking) i.enclosure is a property and no longer a method.
  • (breaking) Indexing or iterating on the atomic intervals of an Interval returns Interval instances instead of AtomicInterval ones.
  • (breaking) An interval is hashable if and only if its bounds are hashable.
  • Huge performance increase for creation, union, intersection, complement and difference of intervals (#21).
  • CLOSED and OPEN are members of the Bound enumeration.
  • Large refactoring to encapsulate AtomicInterval and all its operations in Interval.
  • Restructure package in modules instead of a flat file.
  • Reorganise tests in modules and classes instead of a flat file.
  • Reorganise changelog with explicit categories.

Removed

  • (breaking) Drop support for Python 2.7 and 3.4 since they reached end-of-life.
  • (breaking) AtomicInterval is a namedtuple and is no longer part of the public APP.
  • (breaking) Remove i.to_atomic() (use i.enclosure instead).
  • (breaking) Remove i.is_empty() (use i.empty instead).
  • (breaking) Remove i.is_atomic() (use i.atomic instead).
  • (breaking) CLOSED and OPEN do no longer define an implicit Boolean value. Use ~ instead of not to invert a bound.
  • (breaking) Remove deprecated permissive in i.overlaps.
  • (breaking) Remove adjacent in i.overlaps, use i.adjacent method instead.

Fixed

  • Fix an issue where an interval can be composed of duplicated empty intervals (#19).
  • Fix performance issues when intervals composed of hundreds of atomic intervals are complemented (#20)

Rename to portion

06 Mar 12:52
Compare
Choose a tag to compare

1.10.0-post1, rename library to portion.