-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
Ensure that functions's docstrings pass numpydoc validation #21350
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
Comments
I would like to work on this but I am a beginner so can you explain a bit more on where and how to run? |
@ABHIGPT401 The explanation is already quite detailed. Combined with our contributors guide I am not sure what we can add. Please ask specific questions on gitter: https://gitter.im/scikit-learn/scikit-learn if you need interactive help. |
@fortune-uwha and I are going to work on |
Hi, we are working |
Hi we are working on |
Hi we are working on |
Working on |
Working on sklearn.cluster._optics.cluster_optics_dbscan with @muokicaleb |
@chritter and I are going to work on |
@arisayosh and I are working on |
@dephans and I are working on |
Hi! We are working on |
For those who are running into "YD01: No Yields section found", it could be the cv parameter. Update
|
Working on |
Working on |
Working on |
Working on |
Working on |
Working on |
Working on |
Working on |
Working on |
Working on |
Working on |
Working on |
Working on |
Working on |
Working on |
All functions now pass numpydoc validation. Thanks to everyone who contributed to this long standing issue ! |
Nice. Thank you to everyone that contributed. |
As of right now, not all entries of "yielding" have been removed from the source code, e.g.,
The error "YD01: No Yields section found" is still a problem for numpydoc 1.2 , which is the currently required minimal version. The issue is resolved by updating it manually to 1.3.1 , for example. This is another way of avoiding the YD01 error.
Perhaps, the minimal version requirements should be bumped up. I also wonder why no one else wrote about this issue, given that the quoted line has been around for 4 years according to blame: I can't be the only person whose package manager chooses numpydoc version 1.2, or am I? |
Uh oh!
There was an error while loading. Please reload this page.
Background / Objective
Docstrings in Python are string literals that occur as the first statement in a module, function, class, or method definition.
These are some of the characteristics of a docstring:
numpydoc is one set of criteria to check for consistent documentation structure.
Validating docstrings in scikit-learn
To ensure consistent documentation structure in scikit-learn, we are using numpydoc validation. Currently, documentation tests are failing for various functions. As a temporary fix, we have suppressed error messages in test_docstrings.py. Many of the functions in scikit-learn need to be updated to comply with numpy docstring validation. In the below issue, we provide step-by-step instructions on how contributors can test and update functions.
Note
For those who are running into "YD01: No Yields section found", it could be the cv parameter. Update
An iterable yielding (train, test) splits as arrays of indices
to:Steps
2.1 Make sure you've created a separate branch from
main
before editing files for your new contribution. Refer to our contributing guidelines for more information.scikit-learn/sklearn/tests/test_docstrings.py
Line 14 in 670133d
sklearn._config.config_context
, run numpydoc validation as follows.Addresses #21350
. Note that each item should be submitted in a separate Pull Request.Note: once you have issued 3 such PRs, feel free to move on to contributing more complex pull requests that involve more thinking and leave those issue fixes to first time contributors for them to learn the github contribution workflow :)
Functions to Update
make_gaussian_quantiles
passes numpydoc validation #23996dump_svmlight_file
passes numpydoc validation #23166chi2_kernel
passes numpydoc validation #23945 DOC Ensureadditive_chi2_kernel
passes numpydoc validation #23943 DOC Ensures that sklearn.feature_selection._univariate_selection.chi2 passes numpydoc validation. #23467normalized_mutual_info_score
passes numpydoc validation #24093 DOC Ensures thatmutual_info_score
passes numpydoc validation #24091normalized_mutual_info_score
passes numpydoc validation #24093pair_confusion_matrix
passes numpydoc validation #24094rand_score
passes numpydoc validation #24096v_measure_score
passes numpydoc validation #24097additive_chi2_kernel
passes numpydoc validation #23943check_paired_arrays
passes numpydoc validation #23944chi2_kernel
passes numpydoc validation #23945 DOC Ensureadditive_chi2_kernel
passes numpydoc validation #23943cosine_distances
passes numpydoc validation #23946 DOC Ensures that sklearn.metrics.pairwise.paired_cosine_distances passes numpydoc validation #22141cosine_similarity
passes numpydoc validation #23947distance_metrics
passes numpydoc validation #23949kernel_metrics
passes numpydoc validation #23950paired_manhattan_distances
and make it pass numpydoc validation #23900 DOC Ensures that manhattan_distances passes numpydoc validation #22139paired_manhattan_distances
and make it pass numpydoc validation #23900pairwise_distances_argmin
passes numpydoc validation #23951 DOC Ensurepairwise_distances_argmin_min
passes numpydoc validation #23952pairwise_distances_argmin_min
passes numpydoc validation #23952polynomial_kernel
passes numpydoc validation #23953rbf_kernel
passes numpydoc validation #23954sigmoid_kernel
passes numpydoc validation #23955label_binarize
passes numpydoc validation #24002 DOC Ensures that sklearn.preprocessing._data.binarize passes numpydoc validation #22801normalized_mutual_info_score
passes numpydoc validation #24093 DOC Ensure that normalize passes numpydoc validation #23188 DOC Ensures that preprocessing._data.normalize passes numpydoc validation #22795label_binarize
passes numpydoc validation #24002johnson_lindenstrauss_min_dim
passes numpydoc validation #24003sklearn.utils.extmath.fast_logdet
passes numpydoc validation #24605sklearn.utils.extmath.randomized_svd
passes numpydoc validation #24607The text was updated successfully, but these errors were encountered: