FIX avoid unecessary/duplicated if copy branch for sparse arrays/matrix#27336
FIX avoid unecessary/duplicated if copy branch for sparse arrays/matrix#27336lesteve merged 4 commits intoscikit-learn:mainfrom
if copy branch for sparse arrays/matrix#27336Conversation
| allow_nan=force_all_finite == "allow-nan", | ||
| ) | ||
|
|
||
| if copy: |
There was a problem hiding this comment.
The above if take care about the SciPy sparse copy already. This should only be done in the else.
There was a problem hiding this comment.
I agree that the call to _ensure_sparse_format already takes care of handling the copy argument so there is no need to do it twice for sparse inputs.
|
The remaining failures are in the docstring and a related to the way information is displayed. |
ogrisel
left a comment
There was a problem hiding this comment.
Can you please fix the title of the PR? It's seems grammatically invalid and I am not sure what you mean.
|
I think this PR would be easier to review if it were to focus on a single problem (e.g. the |
np.may_share_memory on sparse arrays
np.may_share_memory on sparse arraysif copy branch for sparse arrays/matrix
|
Let me revert the problem of the representation |
04311c2 to
d65d901
Compare
|
I kind of think this dok array issue is a scipy regression and I was hoping it would get fixed in scipy. I was planning to follow up on scipy/scipy#18929 (comment) for directions. Having said that, if there is an easy work-around that avoids the issue in scikit-learn, why not ... |
I open the following in scipy to kind having something working: scipy/scipy#19220
Actually this is a silent bug where all stars were aligned.
|
ogrisel
left a comment
There was a problem hiding this comment.
Besides the previous comments, the fix itself LGTM!
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
lesteve
left a comment
There was a problem hiding this comment.
LGTM, putting this on auto-merge
…-learn#27336) Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
This should solve the issue observed in the scipy-dev build.
#27171 (comment)
In a later PR, we should make a better test for
check_array.