-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
[MRG] astype sparse matrix #4585
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
Conversation
Do you have any idea why it failed on python3 only? |
I don't think that we want to do that, as this function is in only as a temporary fixes (a backport) for old versions of numpy that doesn't have it. |
I agree that we don't want to change the functionality of |
I had thought it had been just an issue with the Numpy version (with the Travis Py2 builds using <=1.6.2), as opposed to the Python version. I'm not sure whether that's the case, but given the response from travis I've realized that I've fed keyword arguments for positionals, so that for the current commit I've precluded testing the issue. This patch was intended to address the failed tests here: https://travis-ci.org/scikit-learn/scikit-learn/jobs/58113604. |
The goal of this PR is to tackle the limitations of our backport when try to use it more generally as in #4575. Arguably it's no longer just a numpy backport. Still I think it's a useful utility to help use avoid introducing silent memory copies of the input data throughout the code base. |
why not use |
Maybe we could move it under |
Good suggestion. |
I think that would be a good opportunity to add the "allowed dtype" argument that we were talking about at some point ;). |
I agree. |
Maybe we should close this PR then. Sorry @sseg to have mislead you. I hope you won't hold it against me. If you are interested in implementing support patterns such as |
I'm glad to have been a part of fleshing this out. If an issue is opened to implement dtype validation I'll have a look at it, but I don't think I have enough of a grasp of the use cases for sparse arrays. |
Changes astype() in utils/fixes.py which failed on SciPy sparse matrices