Skip to content

TST replace pytest.warns(None) in test_label_propagation.py #23010

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

Merged
merged 14 commits into from
Apr 4, 2022
Merged

TST replace pytest.warns(None) in test_label_propagation.py #23010

merged 14 commits into from
Apr 4, 2022

Conversation

Ben3940
Copy link
Contributor

@Ben3940 Ben3940 commented Mar 31, 2022

Reference Issues/PRs

Part of issue #22572

What does this implement/fix? Explain your changes.

Removes use of pytest.warns(None) due to deprecation warning from Pytest.
warnings.catch_warnings() paired with warnings.simplefilter("error", EXPLICIT_WARNING) will
replace pytest.warns(None)

Ben3940 and others added 10 commits March 30, 2022 09:23
This commit updates the fit(X, y) definition, in the docs, of the sklearn.covariance.EllipticEnvelope class.
The original definition stated that parameter X could be of type 'array-like' or 'sparse matrix', however,
an error would be thrown if a 'sparse matrix' is passed ("TypeError: A sparse matrix was passed, but dense
data is required.").  To resolve this, 'sparse matrix' was removed from the list of types X could be, in the
docstring.
This commit is part of the process to update the docs on the sklearn.covariance.EllipticEnvelope class's
fit(X, y) definition, as explained in issue #14613.
Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
This commit is to resolve part of issue #22572, specifically, refactoring
test_label_propagation.  This is being done to update the file and address
the deprecation warning from Pytest when using "pytest.warns(None)".
…l commit for PR.

Added explicit warnings for warnings.simplefilter() based on test code and, added
missing warnings.simplefilter() call in test_label_propagation_non_zero_normalizer
test.
@Ben3940
Copy link
Contributor Author

Ben3940 commented Mar 31, 2022

@jeremiedbb here is the new PR that is replacing PR #22998. I also see that the PR is currently failing due to linting errors (ci/circle and scikit-learn.scikit-learn (Linting)) and will work on fixing them.

Copy link
Member

@jeremiedbb jeremiedbb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks @Ben3940

@jeremiedbb jeremiedbb added No Changelog Needed Quick Review For PRs that are quick to review labels Mar 31, 2022
@Ben3940
Copy link
Contributor Author

Ben3940 commented Mar 31, 2022

Thank you @jeremiedbb for your help with this

Copy link
Member

@thomasjpfan thomasjpfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the PR!

Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
@jeremiedbb jeremiedbb merged commit 408afcc into scikit-learn:main Apr 4, 2022
@jeremiedbb
Copy link
Member

Thanks @Ben3940

glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Apr 6, 2022
…learn#23010)

Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
jjerphan pushed a commit to jjerphan/scikit-learn that referenced this pull request Apr 29, 2022
…learn#23010)

Co-authored-by: Jérémie du Boisberranger <34657725+jeremiedbb@users.noreply.github.com>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants