-
-
Notifications
You must be signed in to change notification settings - Fork 33
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
Make empty interval comparable by reference #4
Comments
It's quite unusual in Python to use identity operator ( >>> m = []
>>> m is []
False Why not use |
Good point! I did not know about is_empty() and got used to using sympy's singleton EmptyInterval. |
I hope is_empty() will do the job performances-wise ;-) I would be very interested to get your feedback on how python-intervals' performances are in practice. My use cases usually do not exceed tens of intervals, so I don't know if there are bottlenecks. |
My use case involves simulation with a lot of time intervals. For each set of simulation parameters I calculate ~12 time intervals. Then I check if all of them are valid. If they are - then I calculate one intersection of them all and check again if it is valid (not empty). Compared to sympy I see ~30x improvement using python-intervals. |
Thank you! That's a good news ;-) |
I know this issue is quite old and a "workaround" has been found, but since 1.8.0, |
As it is now we have to instantiate I.empty() to compare if the interval is empty:
In certain applications this can have a significant performance impact. Would it be possible to have a singleton for an empty interval, which would allow checking using "is" operator?
The text was updated successfully, but these errors were encountered: