Skip to content

Add check that all parameters are properly documented #7758

Closed

Activity

  1. amueller commented on Oct 27, 2016

    @amueller
    MemberAuthor

    Also see #3791

  2. neerajgangwar commented on Oct 28, 2016

    @neerajgangwar
    Contributor

    @amueller I modified mne-python code and tried it on scikit-learn. There are 225 places where there is an issue in docstring.

    The commit is present here. Feedback to make it better? :)

  3. jnothman commented on Oct 29, 2016

    @jnothman
    Member

    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.

  4. neerajgangwar commented on Oct 30, 2016

    @neerajgangwar
    Contributor

    @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.

  5. raghavrv commented on Oct 30, 2016

    @raghavrv
    Member

    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 :)

  6. neerajgangwar commented on Oct 30, 2016

    @neerajgangwar
    Contributor

    @raghavrv Thanks ! Created a PR and marked it WIP.

  7. jpeacock29 commented on Dec 28, 2016

    @jpeacock29

    A few particular cases (a subset of those referenced in #7901) where documentation is missing:

    • LogisticRegression.classes_
    • MultinomialNB.classes_
  8. jnothman commented on Dec 28, 2016

    @jnothman
    Member
  9. bsipocz commented on Jan 22, 2017

    @bsipocz
    Contributor

    This may be relevant to you, too: pydocstyle can now check for numpy docstyle conventions: PyCQA/pydocstyle#226

  10. jnothman commented on Jan 23, 2017

    @jnothman
    Member

    Thanks @bsipocz, this is interesting, and a little useful. I will comment on that PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions