I am writing a Python module that uses Numpy. I am trying to follow the Numpy docstring format. In many of my functions, the same parameters show up. It seems repetitive to explain what they are in more than one function from the same module. Is there a common practice when dealing with this?
-
1Have you considered changing API to be concise? Like extracting an object or two to encapsulate some state?– BasilevsDec 8, 2016 at 2:59
-
Admittedly, I'm not sure what that means. I'm more so doing scientific computing than software development– VermillionDec 8, 2016 at 3:04
-
Nevermind, discussing this here would be ignorant to your question. My point was to remove argument repetition instead of documenting it.– BasilevsDec 8, 2016 at 3:11
1 Answer
Add a verbose parameter description to class or package documentation and add short reference to it from every function documentation. Basically, bite the bullet. This can't be automated or conveniently enhanced more.