-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Deprecate a couple more find(next|prev) methods, and remove ::Integer on start
#25468
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1269,11 +1269,13 @@ end | |
# (2) base/linalg/qr.jl | ||
# (3) base/linalg/lq.jl | ||
|
||
@deprecate find(x::Number) find(!iszero, x) | ||
@deprecate findnext(A, v, i::Integer) findnext(equalto(v), A, i) | ||
@deprecate findfirst(A, v) findfirst(equalto(v), A) | ||
@deprecate findprev(A, v, i::Integer) findprev(equalto(v), A, i) | ||
@deprecate findlast(A, v) findlast(equalto(v), A) | ||
@deprecate find(x::Number) find(!iszero, x) | ||
@deprecate findnext(A, v, i) findnext(equalto(v), A, i) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should probably keep There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, that was what I was worried about. I'm abandoning the idea of providing a sentinel argument, so keeping this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that these are just deprecations, we don't need to support new features for them anyway. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I was worried about deprecations causing ambiguities. |
||
@deprecate findfirst(A, v) findfirst(equalto(v), A) | ||
@deprecate findprev(A, v, i) findprev(equalto(v), A, i) | ||
@deprecate findlast(A, v) findlast(equalto(v), A) | ||
@deprecate findnext(A::BitArray, v, i) findnext(equalto(v), A, i) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are these two deprecations really needed, given that we have more general versions above? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably not, though I added them to ensure (mostly) the same specificity we have now. Sort of like your argument above about not removing |
||
@deprecate findprev(A::BitArray, v, i) findprev(equalto(v), A, i) | ||
# also remove deprecation warnings in find* functions in array.jl, sparse/sparsematrix.jl, | ||
# and sparse/sparsevector.jl. | ||
|
||
|
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.
I suspect we should keep these for efficiency, but change the signature to
findnext(pred::EqualTo, B::BitArray, start)
. Then inside the function you need to dov = pred.x
.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.
Isn't that mostly covered by this method? The extra code is
O(1)
.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.
Yeah, maybe. So you think there was no reason for the existence of these methods in the first place?