Releases: salt-die/mind_the_gaps
New compactified string construction.
Fix incorrect result for overlaps on singletons.
Changes in v0.4.0
- Fix incorrect result for overlaps on singletons.
- Refactor
_merge
. Logic is simpler while handling above case correctly. - Add tests for these singletons.
- Additional tests covering more complex interval sets.
Minor fixes for Endpoint and Gaps binary operators.
Changes in v0.3.4
Endpoint
andGaps
binary operators returnNotImplemented
when relevant.Gaps
binary operators now correctly return subclass type.
Non-minimally expressed sets of intervals cleaned up during initialization.
Changes
- Non-minimally expressed sets of intervals cleaned up during initialization.
Endpoint.__lt__
andEndpoint.__eq__
now make more mathematical sense.- Added
py.typed
Minor bug fixes. (Re-release.)
No longer allowed to create gaps with intervals such as {(5, 5)}
and {[0], [0]}
since these aren't minimally expressed.
contains no longer errors for values larger than the last endpoint.
Minor bug fixes.
No longer allowed to create gaps with intervals such as {(5, 5)}
since this isn't minimally expressed.
__contains__
no longer errors for values larger than the last endpoint.
Removed `Gap.__invert__()` and made `Var` public.
Gap.__invert__
makes poor assumptions about the bounds of a Gaps generic type. It's better not to make any assumptions and remove this operator. PositiveInfinity
and NegativeInfinity
are also removed with this change. Gaps can still be inverted "by hand", e.g. my_gaps ^ Gaps([some_smallest_value < x, x < some_largest_value])
.
Var
is now public. Useful if x
is already in your namespace.
Create gaps from strings or from `x`.
Create gaps from a string or from x
, e.g.,
>>> from mind_the_gaps import Gaps, x
>>> 0 <= x
Endpoint(value=0, boundary='[')
>>> x < 1
Endpoint(value=1, boundary=')')
>>> print(Gaps([0 <= x, x < 1]))
{[0, 1)}
>>> print(Gaps.from_string("{[0, 1)}"))
{[0, 1)}
Initial alpha release.
Mind the gaps!
Gaps are sets of mutually exclusive sorted intervals that can be union-ed, intersected, xor-ed, or subtract-ed.