-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
TST Extend tests for scipy.sparse.*array
in sklearn/utils/tests/test_param_validation.py
#27317
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
TST Extend tests for scipy.sparse.*array
in sklearn/utils/tests/test_param_validation.py
#27317
Conversation
scipy.sparse.*array
in sklearn/utils/tests/test_param_validation.py
Could someone please help why the build is failing |
@jeremiedbb I would be inclined at not changing this part of the code for the moment. Maybe we could in the future generate both a sparse array and a sparse matrix. |
@@ -850,7 +850,7 @@ def generate_valid_param(constraint): | |||
if isinstance(constraint, _ArrayLikes): | |||
return np.array([1, 2, 3]) | |||
|
|||
if isinstance(constraint, _SparseMatrices): | |||
if isinstance(constraint, _SparseContainers): | |||
return csr_matrix([[0, 1], [1, 0]]) |
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.
return csr_matrix([[0, 1], [1, 0]]) | |
return csr_array([[0, 1], [1, 0]]) |
if isinstance(constraint, str) and constraint == "sparse container": | ||
return _SparseContainers() |
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.
We need to change all the occurrences of "sparse matrix"
to "sparse container"
for input parameters' validation. Doc-strings also need to be changed accordingly.
Hi @naman1608, Do you still have time to finish this contribution? |
@Charlie-XIAO: are you interested in continuing this work? |
@jjerphan Okay sure, I will take a look later. |
@jjerphan Btw, I want to make sure whether we do want to change all occurrences of "sparse matrix" into "sparse container", given #27317 (comment)? Or do we change only for those that have been tested while still keeping the "sparse matrix" option? |
I think this is the best option. We probably want to discuss changing |
Hello @Charlie-XIAO, are you still interested in continuing this PR? |
@jjerphan Yes I am. I’m extremely sorry for the delay because I was working on a capstone and some exams in the past few weeks. I will be able to work on it soon (within a week). |
Hi @Charlie-XIAO, Take your time: it is fine, really. I just wanted to know in case someone else new to the project could have started with a contribution like this. Good luck with your exams! |
I'm going to close this one because of #28101. |
Reference Issues/PRs
Towards #27090.
What does this implement/fix? Explain your changes.
Any other comments?