Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

TST Fixes docstring ordering and test_docstring_parameters #19048

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
Feb 12, 2021

Conversation

thomasjpfan
Copy link
Member

This PR fixes test_docstring_parameters so that it actually runs and the corresponding failures it sees in the docstrings.

@jnothman
Copy link
Member

With the change to parametrize, it's hard to see the diff. Is the change to parametrize functional, i.e. is it helping to isolate errors? Otherwise, what's the big change here?

Comment on lines 87 to 88
classes = [cls for cls in classes
if cls[1].__module__.startswith(name)]
Copy link
Member Author

Choose a reason for hiding this comment

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

@jnothman Here is the change. The parameterize was to make it easier for me to see all the errors at once.

I reverted the parameterize so the diff is smaller.

Copy link
Member

Choose a reason for hiding this comment

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

Do I understand correctly that the problem was that name is e.g. sklearn.cross_decomposition while cls[1].__module__ is sklearn.cross_decomposition._pls?

Copy link
Member

Choose a reason for hiding this comment

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

and if that's the case can we just do

classes = [cls for cls in classes if cls[1].__module__.startswith('sklearn')]

?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup that is nicer. Updated PR with your suggestion.


Parameters
----------
df : pandas DataFrame
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to enforce the style here: dataframe of shape ...?

@thomasjpfan
Copy link
Member Author

@NicolasHug Issues like #19197 are not being caught because test_docstring_parameters needs to be updated as shown in this PR.

@thomasjpfan thomasjpfan changed the title DOC Fixes docstring ordering and test_docstring_parameters TST Fixes docstring ordering and test_docstring_parameters Jan 19, 2021
Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

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

Thanks @thomasjpfan , LGTM modulo confirmation on my question below

@@ -84,7 +84,8 @@ def test_docstring_parameters():
module = importlib.import_module(name)
classes = inspect.getmembers(module, inspect.isclass)
# Exclude imported classes
Copy link
Member

Choose a reason for hiding this comment

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

Nit:

Suggested change
# Exclude imported classes
# Exclude non-scikit-learn classes

Comment on lines 87 to 88
classes = [cls for cls in classes
if cls[1].__module__.startswith(name)]
Copy link
Member

Choose a reason for hiding this comment

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

Do I understand correctly that the problem was that name is e.g. sklearn.cross_decomposition while cls[1].__module__ is sklearn.cross_decomposition._pls?

Base automatically changed from master to main January 22, 2021 10:53
@rth rth merged commit 95fa18f into scikit-learn:main Feb 12, 2021
@glemaitre glemaitre mentioned this pull request Apr 22, 2021
12 tasks
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Apr 22, 2021
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.

5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.