-
Notifications
You must be signed in to change notification settings - Fork 18
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
Handle empty-interval edge case in find_intersections
#201
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #201 +/- ##
==========================================
+ Coverage 84.31% 84.35% +0.03%
==========================================
Files 12 12
Lines 848 850 +2
==========================================
+ Hits 715 717 +2
Misses 133 133
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
closes #200?
I suggested arranging the dispatches slightly differently there, which I think has some advantages. With this version:
- Empty checks are repeated in two methods
- errors depend on contents, not type: if the array has the wrong type and is empty, no error. Non-empty, and error
test/anchoredinterval.jl
Outdated
@@ -583,7 +583,7 @@ using Intervals: Bounded, Ending, Beginning, canonicalize, isunbounded | |||
r = r[1:5] | |||
|
|||
# https://github.com/JuliaLang/julia/issues/33882 | |||
@test r isa StepRangeLen | |||
@test r isa (VERSION < v"1.8" ? StepRangeLen : StepRange) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Best to make these fixes as separate PRs so they can be merged faster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After looking into it I think this fix is incorrect. I've made a new fix in #204
@test r isa (VERSION < v"1.8" ? StepRangeLen : StepRange) | |
@test r isa StepRangeLen |
ffa9a1a
to
375dd59
Compare
Closes #200
Title says it all. This fix also will address some edge cases where
find_intersections
would throw a StackOverflowError when passed an incorrect type.Small aside: When I ran tests locally there was a failure on 1.8 (had to run on 1.7). Looks to be related to a now closed issue in 1.8.