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
Document numpy.lib.stride_tricks.as_strided #6565
Comments
Intentionally! It's dangerous! It was just low-level plumbing to help implement |
Fair enough. FWIW, it is mentioned as a "See also" in the docs of |
In https://github.com/numpy/numpy/blob/master/numpy/lib/stride_tricks.py the two functions in |
It'd be great if we could not move or deprecate that. There's plenty of code that relies on it out there (e.g. the various rolling window idioms floating around, among other things). IMHO it makes more sense to add it to the docs and say explicitly that it's dangerous and ought not to be used when another option is available. |
I agree with @insertinterestingnamehere that it would be better to add it to the docs with lots of warnings and disclaimers. For what it's worth, it's definitely part of the implicit public API at this point -- there is plenty of code that relies on it. Note that as of NumPy 1.10 we don't even rely on |
I agree as well - add to the docs with a clear "this is dangerous" at the top of the docstring.
Maybe that was the idea, but it doesn't work so well in practice. Same for stuff that's not in the docs. |
I'd like also vote for leaving and documenting as_strided. This is very useful function. |
(I was going to ask about making official functions for this and then found #7753, so linking that from here for anyone else who is looking.) |
As far as I can tell
as_strided
(which can be rather useful, even though it is involved) is documented nowhere -- it doesn't even appear in the general index, probably because it isn't listed instride_tricks.__all__
.The text was updated successfully, but these errors were encountered: