-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
alternatives to doccer? #27
Comments
In scikit-learn, we have a tests to enforce constraints on the docstring parameters: I never pushed for a dynamic way to fill in the docstrings, because of the issues with static analyzers. |
Thanks @thomasjpfan. We have similar tests in MNE-Python (probably we copied ours from sklearn) but like your tests, they don't enforce much about the content of the parameter descriptions, mostly just ensuring that they exist and that they come in the same order as the function signature.
It's seeming like the only option that both works with static analysis and also preserves consistency across the API would be to go back to having our docstrings all hard-coded in the source files, maintaining a mapping somewhere saying "the param description for |
To be honest, I'd prefer almost anything over doccer expansion at this point. Besides static analyzers, the benefit of being able to just read docstrings in the source cannot be overstated. |
I am also not a fan of "docstrings with holes in them" aka things that aren't fully readable by opening the source file in a simple text editor. A random idea: maybe generating the docstring once and writing it to the source file is something to investigate? Could be a tool that you run on a new class/function. For example to generate a docstring for That way the initial docstring would be consistent with the rules. You could even imagine something like |
One thing I hoped to talk about at the summit but didn't manage to was doccer (SciPy's internal tool for docstring deduplication). MNE-Python adopted/adapted doccer many years ago, and it helped us find and fix many outdated/inaccurate docstrings.
The problem we're facing is that
Problem 1 alone wouldn't be so bad (arguably an advantage, as it reduces scrolling past screens and screens of docstring between snatches of actual code), but combined with problem 2 it has left some of our devs in a perpetually frustrated state.
My questions are:
?
(likemne.what.ever?
)" but I'm interested in other approachesThe text was updated successfully, but these errors were encountered: