Is there a way to attach a Python file to verify that the documentation style is in Nump format?

I am working on a project that requires Numpy documentation. In my Java days, I remember that you have linters that tested Javadoc's commitment to Eclipse / IDEA; Is there an equivalent that validates Numpy's documentation style?

I know about PEP257, but it does not seem to have any specific Numpy documentation checks.

+6
source share
1 answer

Pilint seems to support this. Take a look at pylint.extensions.docparams .

Summarizing. You activate this pylint control by adding

load-plugins=pylint.extensions.docparams 

in the "Wizard" section of your .pylintrc .

This check verifies that all functions, the method, and the docstrings constructor include documentation

  • parameters and their types

  • return value and its type

  • exceptions raised


In fact, pydocstyle (formerly pep257) recently added support for the numpy docstring convention. Although this is not ideal, I think it is closest to what you want to achieve, and it is likely to improve in the near future.

 pydocstyle --convention=numpy example.py 
+3
source

Source: https://habr.com/ru/post/1014819/


All Articles