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

IntervalDict items are not correctly sorted #39

Closed
AlexandreDecan opened this issue Sep 16, 2020 · 1 comment
Closed

IntervalDict items are not correctly sorted #39

AlexandreDecan opened this issue Sep 16, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@AlexandreDecan
Copy link
Owner

Items in an IntervalDict are sorted according to their lower bound, but when a bound is shared by two intervals (= keys), the open interval is listed first instead of the closed one:

>>> d = P.IntervalDict()
>>> d[P.open(2, 3)] = 1
>>> d
{(2,3): 1}
>>> d[2] = 2
>>> d
{(2,3): 1, [2]: 2}

The expected output should be [2] then (2, 3).

@AlexandreDecan AlexandreDecan added the bug Something isn't working label Sep 16, 2020
AlexandreDecan added a commit that referenced this issue Sep 16, 2020
@AlexandreDecan AlexandreDecan changed the title IntervalDict items are not correctly stored IntervalDict items are not correctly sorted Sep 16, 2020
@AlexandreDecan
Copy link
Owner Author

Fixed in 39e2564

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant