-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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 circshift() and make it lazy #25003
Comments
Do we need it in Base at all? Seems like there are no uses, only definitions, which suggest to me that it would make a good stdlib package. |
Probably, but what package? Something were we'd also put |
Initially, it could just be |
We could try to find a slightly more general name from the start to avoid renaming it if possible. |
For me this seem to belong to a module that groups: Array slicing, Array reshaping, Array transpose. Its not super necessary that |
Slicing, reshaping and transpose are really basic features, I'm not sure we want to move them to stdlib... |
If we're talking about slicing |
|
be still my heart |
We can probably punt on this for 1.0. |
That's clearly not a big issue, but if we want to deprecate the functions something will have to be done before 1.0 (either a deprecation or moving them to stdlib). |
This can be a vestigial API at some point in the future when a lovely, complete lazy package exists. |
Implemented in the ShiftedArrays package, together with |
I guess the question now is what do we want the relationship between this Base function and the ShiftedArrays package to be? Should we consider deprecating it entirely and pointing people at the package instead? Or should we retain this as a way of doing eager array shifting? |
This came up in a Slack discussion about adding
lag
andlead
functions, which are similar tocircshift
. In many cases, allocating a vector to store the result ofcircshift
is a waste, as a lazy view would be sufficient and as efficient. Looking at uses ofcircshift
on GitHub shows several examples where the result is discarded immediately.It would make sense to have
Iterators.circshift
, returning a customAbstractArray
object which would redirectgetindex
calls to the parent after shifting the index.circshift!(dest, src, shift)
would be replaced withcopy!(dest, Iterators.circshift(src, shift))
.The text was updated successfully, but these errors were encountered: