You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add check that all parameters are properly documented #7758
Perhaps make a pull request so we can see to what extent these can be easily fixed. I recall writing a script to list these inconsistencies once (perhaps I have it as a Gist) but that there were some tricky cases.
@jnothman Earlier I kept the script in sklearn/tests directory as a testcase. But the test suite was failing for obvious reasons. So I decided to move it to sklearn/utils for now but I am not able to run the script. It's giving following error
Traceback (most recent call last):
File "check_docstring_parameters.py", line 3, in <module>
from numpydoc import docscrape
File "/home/neeraj/Applications/anaconda/lib/python2.7/site-packages/numpydoc/__init__.py", line 3, in <module>
from .numpydoc import setup
File "/home/neeraj/Applications/anaconda/lib/python2.7/site-packages/numpydoc/numpydoc.py", line 32, in <module>
from sphinx.util.compat import Directive
File "/home/neeraj/Applications/anaconda/lib/python2.7/site-packages/Sphinx-1.4.1-py2.7.egg/sphinx/util/__init__.py", line 16, in <module>
import tempfile
File "/home/neeraj/Applications/anaconda/lib/python2.7/tempfile.py", line 35, in <module>
from random import Random as _Random
File "/home/neeraj/Projects/github/scikit-learn/sklearn/utils/random.py", line 5, in <module>
import numpy as np
File "/home/neeraj/Applications/anaconda/lib/python2.7/site-packages/numpy/__init__.py", line 184, in <module>
from . import add_newdocs
File "/home/neeraj/Applications/anaconda/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/home/neeraj/Applications/anaconda/lib/python2.7/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/home/neeraj/Applications/anaconda/lib/python2.7/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/home/neeraj/Applications/anaconda/lib/python2.7/site-packages/numpy/core/__init__.py", line 58, in <module>
from numpy.testing.nosetester import _numpy_tester
File "/home/neeraj/Applications/anaconda/lib/python2.7/site-packages/numpy/testing/__init__.py", line 12, in <module>
from . import decorators as dec
File "/home/neeraj/Applications/anaconda/lib/python2.7/site-packages/numpy/testing/decorators.py", line 21, in <module>
from .utils import SkipTest
File "/home/neeraj/Applications/anaconda/lib/python2.7/site-packages/numpy/testing/utils.py", line 15, in <module>
from tempfile import mkdtemp, mkstemp
ImportError: cannot import name mkdtemp
I can't seem to figure out a way to run it from sklearn/utils directory. I searched for the error and found this issue #4620. I am able to run from tempfile import mkdtemp, mkstemp from all directories but sklearn/utils.
Earlier I kept the script in sklearn/tests directory as a testcase. But the test suite was failing for obvious reasons. So I decided to move it to sklearn/utils for now but I am not able to run the script. It's giving following error
I suggest that you move back the test to the sklearn/tests directory and make a PR... It's easier to review a PR than a commit or a traceback...
It's okay if the CI fails... We can address the failures (which is the whole point of this issue) one by one :)
Activity
amueller commentedon Oct 27, 2016
Also see #3791
neerajgangwar commentedon Oct 28, 2016
@amueller I modified
mne-pythoncode and tried it onscikit-learn. There are 225 places where there is an issue in docstring.The commit is present here. Feedback to make it better? :)
jnothman commentedon Oct 29, 2016
Perhaps make a pull request so we can see to what extent these can be easily fixed. I recall writing a script to list these inconsistencies once (perhaps I have it as a Gist) but that there were some tricky cases.
neerajgangwar commentedon Oct 30, 2016
@jnothman Earlier I kept the script in
sklearn/testsdirectory as a testcase. But the test suite was failing for obvious reasons. So I decided to move it tosklearn/utilsfor now but I am not able to run the script. It's giving following errorI can't seem to figure out a way to run it from
sklearn/utilsdirectory. I searched for the error and found this issue #4620. I am able to runfrom tempfile import mkdtemp, mkstempfrom all directories butsklearn/utils.raghavrv commentedon Oct 30, 2016
I suggest that you move back the test to the
sklearn/testsdirectory and make a PR... It's easier to review a PR than a commit or a traceback...It's okay if the CI fails... We can address the failures (which is the whole point of this issue) one by one :)
neerajgangwar commentedon Oct 30, 2016
@raghavrv Thanks ! Created a PR and marked it WIP.
jpeacock29 commentedon Dec 28, 2016
A few particular cases (a subset of those referenced in #7901) where documentation is missing:
LogisticRegression.classes_MultinomialNB.classes_jnothman commentedon Dec 28, 2016
bsipocz commentedon Jan 22, 2017
This may be relevant to you, too: pydocstyle can now check for numpy docstyle conventions: PyCQA/pydocstyle#226
jnothman commentedon Jan 23, 2017
Thanks @bsipocz, this is interesting, and a little useful. I will comment on that PR.