10000 MNT Update sklearn.externals._lobpcg.lobpcg docstring according to https://github.com/scipy/scipy/pull/16432 by Diadochokinetic · Pull Request #23597 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

MNT Update sklearn.externals._lobpcg.lobpcg docstring according to https://github.com/scipy/scipy/pull/16432 #23597

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 7 commits into from
Jun 22, 2022

Conversation

Diadochokinetic
Copy link
Contributor
@Diadochokinetic Diadochokinetic commented Jun 12, 2022

Reference Issues/PRs

Fixes #23596

What does this implement/fix? Explain your changes.

pytest -vl sklearn/tests/test_docstrings.py -k test_docstring throws a ValueError for sklearn.externals._lobpcg.lobpcg. A quick fix would be to add the function to FUNCTION_DOCSTRING_IGNORE_LIST and simply exclude it from the test. A proper fix would be to actually fix the errors on the docstring:

E # Errors
E
E - GL03: Double line break found; please use only one blank line to separate sections or paragraphs, and do not leave blank lines at the end of docstrings
E - SS03: Summary does not end with a period
E - PR08: Parameter "Y" description should start with a capital letter
E - RT05: Return value description should finish with "."

Edit: Fixing the docstring wasn't that hard. Therefore I suggest to go for that solution.

Any other comments?

I started by simply adding the function to the ignore list. Then I fixed the docstring and removed the function from the ignore list. Now the tests run successfully.

EDIT: The externals module should actually be excluded from docstring tests. It is unknown, why it happens on my local machine. Since there is already a function from the externals module listet in FUNCTION_DOCSTRING_IGNORE_LIST, this probably happened before. Therefore simply adding it to the ignored list is preferred.

@Diadochokinetic Diadochokinetic changed the title [WIP] Fix sklearn.externals._lobpcg.lobpcg throws ValueError in test_function_docstring [MRG] Fix sklearn.externals._lobpcg.lobpcg throws ValueError in test_function_docstring Jun 12, 2022
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.

I'm okay with this temporary solution.

My preferred solution is to debug what the issue is on your system and fix get_all_functions_names itself. I am not able to reproduce the issue on my system so it's harder for me to debug.

…dule doesn't work on some systems

Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
@glemaitre
Copy link
Member

But we should already ignore it, isn't it:

def get_all_functions_names():
"""Get all public functions define in the sklearn module"""
modules_to_ignore = {
"tests",
"externals",
"setup",
"conftest",
"experimental",
"estimator_checks",
}

@Diadochokinetic
Copy link
Contributor Author

But we should already ignore it, isn't it:

Yes, it should be ignored. But for some unknown reason the test runs and fails on my local machine. Since there is already another function of the externals module listed in FUNCTION_DOCSTRING_IGNORE_LIST. I assume, I am not the first one encountering this problem.

@Diadochokinetic
Copy link
Contributor Author

The Scipy devs fixed the docstring themselves scipy/scipy#16432. I updated this PR accordingly.

@Diadochokinetic Diadochokinetic changed the title [MRG] Fix sklearn.externals._lobpcg.lobpcg throws ValueError in test_function_docstring [MRG] MNT Update sklearn.externals._lobpcg.lobpcg docstring according to https://github.com/scipy/scipy/pull/16432 Jun 20, 2022
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.

With SciPy updated, I am okay with correcting here to keep in sync with SciPy.

@thomasjpfan thomasjpfan added the Quick Review For PRs that are quick to review label Jun 21, 2022
@thomasjpfan thomasjpfan changed the title [MRG] MNT Update sklearn.externals._lobpcg.lobpcg docstring according to https://github.com/scipy/scipy/pull/16432 MNT Update sklearn.externals._lobpcg.lobpcg docstring according to https://github.com/scipy/scipy/pull/16432 Jun 21, 2022
@glemaitre glemaitre merged commit f78f6b2 into scikit-learn:main Jun 22, 2022
@glemaitre
Copy link
Member

Thanks @Diadochokinetic Merging

@Diadochokinetic Diadochokinetic deleted the lobpcg_docstring branch June 22, 2022 12:43
ogrisel pushed a commit to ogrisel/scikit-learn that referenced this pull request Jul 11, 2022
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Aug 4, 2022
glemaitre pushed a commit that referenced this pull request Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Quick Review For PRs that are quick to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sklearn.externals._lobpcg.lobpcg throws ValueError in test_function_docstring
3 participants
0