Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unioning Discrete Adjacent Intervals #38

Open
vansivallab opened this issue Oct 20, 2017 · 1 comment
Open

Unioning Discrete Adjacent Intervals #38

vansivallab opened this issue Oct 20, 2017 · 1 comment

Comments

@vansivallab
Copy link

There is an issue with how discrete intervals which are adjacent but don't share bound values are not unioned correctly.

As an example:

>>> IntInterval([1,2]) | IntInterval((2, 4))
IntInterval('[1, 4)')
>>> IntInterval((2,4)) == IntInterval((3,4), lower_inc=True)
 True
>>> IntInterval([1,2]) | IntInterval((3,4), lower_inc=True)
IllegalArgument                           Traceback (most recent call last)
~/.../intervals/interval.py in __or__(self, other)
    630         """
    631         if not self.is_connected(other):
--> 632             raise IllegalArgument('Union is not continuous.')
    633         lower = min(self.lower, other.lower)
    634         upper = max(self.upper, other.upper)

IllegalArgument: Union is not continuous.
@vansivallab
Copy link
Author

vansivallab commented Oct 20, 2017

I think this has to do with how the is_connected method handles adjacent discrete intervals.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant