8000 DOC docstring (shape= -> of shape) by adrinjalali · Pull Request #14640 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content

DOC docstring (shape= -> of shape) #14640

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 45 commits into from
Oct 3, 2019

Conversation

adrinjalali
Copy link
Member

This PR makes our docstrings a bit more compliant with our brand-new style (#12356)

@adrinjalali adrinjalali changed the title Doc/array shape DOC docstring (shape= -> of shape) Aug 13, 2019
@adrinjalali adrinjalali changed the title DOC docstring (shape= -> of shape) [MRG] DOC docstring (shape= -> of shape) Aug 13, 2019
Copy link
Member
@glemaitre glemaitre left a comment

Choose a reason for hiding this comment

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

LGTM. Single question: you make the sample_weight docstring consistent but you removed the default=None. I was checking the documentation but this is not mentioned. What is the policy for the default in this case.

@adrinjalali
Copy link
Member Author

I didn't really try to touch the default much, but to me array-like of shape (n_samples,) or None kinda implicitly says that the default is None, don't you think? Also, I think we may end up fixing those rules as we go along and we encounter cases where the rules don't make much sense, maybe?

@glemaitre
Copy link
Member

OK it makes sense to me. We might just think about adding these into the contributing guide we are settled.

@thomasjpfan
Copy link
Member

I see three options with handling default=None:

  1. array-like of shape (n_samples,) or None, default=None

  2. array-like of shape (n_samples,) or None

  3. array-like of shape (n_samples,), default=None

@adrinjalali
Copy link
Member Author

I kinda like option 3

@adrinjalali
Copy link
Member Author

I think I don't have permissions to do that @glemaitre , I'll send another commit to get them run.

@adrinjalali
Copy link
Member Author

@glemaitre they pass now :)

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.

What do you think of adding a small test where if shape is in parameters docstring it must match the following regex:

of shape \([\w, ]+\)

@adrinjalali
Copy link
Member Author

What do you think of adding a small test where if shape is in parameters docstring it must match the following regex:

of shape \([\w, ]+\)

makes sense to me, I'd just add a .* at the end of that.

@glemaitre
Copy link
Member

Still my +1. You can add a test if you want.

@adrinjalali
Copy link
Member Author

I rather have the test in a separate PR though.

@glemaitre
Copy link
Member

Fine with me

@thomasjpfan thomasjpfan changed the title [MRG] DOC docstring (shape= -> of shape) DOC docstring (shape= -> of shape) Oct 3, 2019
@thomasjpfan thomasjpfan merged commit 0eebade into scikit-learn:master Oct 3, 2019
@adrinjalali adrinjalali deleted the doc/array-shape branch October 4, 2019 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0