numpydoc

Can mypy check docstrings?

╄→гoц情女王★ 提交于 2021-02-18 12:12:38
问题 I have numpydoc-style docstrings: def foobar(filename, copy, dtype, iterable, shape, files): """ foobar is 42. Parameters ---------- filename : str copy : bool dtype : data-type iterable : iterable object shape : int or tuple of int files : list of str Returns ------- foobarfoo : int """ pass Is it possible to check if the docstring-types can possibly be correct? (side question: Can numpy return/print the function signatures it discovered?) For example, I would expect the following to fail:

Can mypy check docstrings?

元气小坏坏 提交于 2021-02-18 12:10:42
问题 I have numpydoc-style docstrings: def foobar(filename, copy, dtype, iterable, shape, files): """ foobar is 42. Parameters ---------- filename : str copy : bool dtype : data-type iterable : iterable object shape : int or tuple of int files : list of str Returns ------- foobarfoo : int """ pass Is it possible to check if the docstring-types can possibly be correct? (side question: Can numpy return/print the function signatures it discovered?) For example, I would expect the following to fail:

Can mypy check docstrings?

女生的网名这么多〃 提交于 2021-02-18 12:10:01
问题 I have numpydoc-style docstrings: def foobar(filename, copy, dtype, iterable, shape, files): """ foobar is 42. Parameters ---------- filename : str copy : bool dtype : data-type iterable : iterable object shape : int or tuple of int files : list of str Returns ------- foobarfoo : int """ pass Is it possible to check if the docstring-types can possibly be correct? (side question: Can numpy return/print the function signatures it discovered?) For example, I would expect the following to fail:

WARNING: toctree contains reference to nonexisting document error with Sphinx

浪子不回头ぞ 提交于 2020-12-31 11:50:46
问题 I started using Sphinx a couple of days ago to document a python package, and I'm getting what seems to be a common error, but I cannot find a solution for it. I used the sphinx-quickstart to set everything up. I used "doc/" for the documentation root location. The folder containing my package is setup as: myfolder/ doc/ mypackage/ __init__.py moprob.py ... After the quick start, I edited the path in conf.py to be: import os import sys sys.path.insert(0, os.path.abspath('..')) Then I added

WARNING: toctree contains reference to nonexisting document error with Sphinx

折月煮酒 提交于 2020-12-31 11:47:44
问题 I started using Sphinx a couple of days ago to document a python package, and I'm getting what seems to be a common error, but I cannot find a solution for it. I used the sphinx-quickstart to set everything up. I used "doc/" for the documentation root location. The folder containing my package is setup as: myfolder/ doc/ mypackage/ __init__.py moprob.py ... After the quick start, I edited the path in conf.py to be: import os import sys sys.path.insert(0, os.path.abspath('..')) Then I added

Is it possible to hide Python function arguments in Sphinx?

邮差的信 提交于 2020-07-08 03:58:11
问题 Suppose I have the following function that is documented in the Numpydoc style, and the documentation is auto-generated with the Sphinx autofunction directive: def foo(x, y, _hidden_argument=None): """ Foo a bar. Parameters ---------- x: str The first argument to foo. y: str The second argument to foo. Returns ------- The barred foo. """ if _hidden_argument: _end_users_shouldnt_call_this_function(x, y) return x + y I don't want to advertise the hidden argument as part of my public API, but it

Sphinx not removing doctest flags in html output

风流意气都作罢 提交于 2020-05-31 03:04:31
问题 I cannot eliminate the doctest flags (ie. <BLANKLINE> , # doctest: +ELLIPSIS ) for the html output. I am able to generate the documentation as I would like, so no errors there but it includes theses flags which I would like removed. Sphinx documentation here claims this is possible so I must be doing something wrong. My documentation examples are in numpy style and I have tried using both the napoleon and numpydoc extensions. Here are the steps I have taken. run sphinx-quickstart (enabling

Is there any way to lint a Python file to check for Numpy documentation style adherence? [closed]

久未见 提交于 2019-12-07 01:24:49
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed last year . I'm working on a project that requires Numpy documentation. In my Java days, I remember having linters that checked for Javadoc adherence in Eclipse/IDEA; is there an equivalent that checks for Numpy documentation style adherence? I know about PEP257, but it doesn't seem to have any specific checks for Numpy

Is there any way to lint a Python file to check for Numpy documentation style adherence? [closed]

旧巷老猫 提交于 2019-12-05 04:42:23
I'm working on a project that requires Numpy documentation. In my Java days, I remember having linters that checked for Javadoc adherence in Eclipse/IDEA; is there an equivalent that checks for Numpy documentation style adherence? I know about PEP257, but it doesn't seem to have any specific checks for Numpy documentation. Pylint seems to support that. Take a look at pylint.extensions.docparams . To sum it up. You activate this checker of pylint by adding load-plugins=pylint.extensions.docparams in the Master section of your .pylintrc . This checker verifies that all function, method, and