Skip to content

[MRG] Updated docstrings for TfidfVectorizer functions #15509

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 10 commits into from
Nov 15, 2019

Conversation

hailey0huong
Copy link
Contributor

@hailey0huong hailey0huong commented Nov 2, 2019

Reference Issues/PRs

Reference #15440

What does this implement/fix? Explain your changes.

Updated docstrings for TfidfVectorizer functions to pass numpydoc validation

Any other comments?

There are some methods left under this class got TypeError while running python maint_tools/test_docstrings.py that I don't know how to fix: idf_, norm, smooth_idf, sublinear_tf, use_idf

The error is below:
Traceback (most recent call last): File "maint_tools/test_docstrings.py", line 173, in <module> msg = repr_errors(res, method=args.import_path) File "maint_tools/test_docstrings.py", line 112, in repr_errors for code, message in res["errors"] TypeError: sequence item 0: expected str instance, NoneType found

Copy link
Member

@rth rth left a comment

Choose a reason for hiding this comment

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

Thanks @hailey0huong ! A few comments below.

Returns
-------
feature_names : list
A list of feature name.
Copy link
Member

Choose a reason for hiding this comment

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

This line should be indented only 4 spaces more than the one above

@@ -1770,11 +1807,14 @@ def fit(self, raw_documents, y=None):
Parameters
----------
raw_documents : iterable
an iterable which yields either str, unicode or file objects
An iterable which has either str, unicode or file objects.
Copy link
Member

Choose a reason for hiding this comment

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

Please revert "has -> yields", as an iterable does yield objects.

"""Return a callable that handles preprocessing, tokenization

"""
Return a callable that handles preprocessing, tokenization
Copy link
Member

Choose a reason for hiding this comment

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

Please revert the added line break.
It should be

"""Return ...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just updated the format as your suggestions. Thanks!

hailey0huong and others added 7 commits November 3, 2019 19:41
Co-Authored-By: Roman Yurchak <rth.yurchak@gmail.com>
Co-Authored-By: Roman Yurchak <rth.yurchak@gmail.com>
Co-Authored-By: Roman Yurchak <rth.yurchak@gmail.com>
Co-Authored-By: Roman Yurchak <rth.yurchak@gmail.com>
Co-Authored-By: Roman Yurchak <rth.yurchak@gmail.com>
Co-Authored-By: Roman Yurchak <rth.yurchak@gmail.com>
Copy link
Member

@rth rth left a comment

Choose a reason for hiding this comment

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

On last comment otherwise LGTM.

Co-Authored-By: Roman Yurchak <rth.yurchak@gmail.com>
@rth
Copy link
Member

rth commented Nov 15, 2019

Thanks, merging! The Codecov failure is not relevant (only docstrings changed in this PR).

@rth rth merged commit 25a88b4 into scikit-learn:master Nov 15, 2019
adrinjalali pushed a commit to adrinjalali/scikit-learn that referenced this pull request Nov 18, 2019
adrinjalali pushed a commit to adrinjalali/scikit-learn that referenced this pull request Nov 18, 2019
panpiort8 pushed a commit to panpiort8/scikit-learn that referenced this pull request Mar 3, 2020
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