Skip to content
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

Ensure that parameters are documented #5504

Open
bsipocz opened this issue Nov 24, 2016 · 12 comments
Open

Ensure that parameters are documented #5504

bsipocz opened this issue Nov 24, 2016 · 12 comments

Comments

@bsipocz
Copy link
Member

bsipocz commented Nov 24, 2016

I think we should consider implementing (copying over) the solution of sklearn to make our documentation better (and enforce to keep it that way).

scikit-learn/scikit-learn#7758

I've already made some fixes in #5503, but it would be very nice to see that we can force not to diverge.

@mhvk
Copy link
Contributor

mhvk commented Nov 25, 2016

(from #5503) -- sounds good to try to use any solution they come up with!

@MSeifert04
Copy link
Contributor

I haven't looked at the details but it raises the interesting question if we really want all functions to contain parameter-lists (i.e. aliased or deprecated functions) and how we should handle decorated functions, where the signature is explicitly changed or removed?

@bsipocz
Copy link
Member Author

bsipocz commented Nov 26, 2016

@MSeifert04 - There can be exceptions, especially for deprecated things, but we should aim to spot the odd case of forgetting to add/update the docstring.

@bsipocz
Copy link
Member Author

bsipocz commented Dec 6, 2016

In a related issue (gammapy/gammapy#325), @cdeil mentions https://github.com/PyCQA/pydocstyle as a tool we might be able to use for this (similarly to our pycodestyle checks). However it's not yet clear when it will work with numpydoc style docstrings.

@hamogu
Copy link
Member

hamogu commented Dec 15, 2016

I had a working version of something very similar to this in #1196, but then the require module was moved into astropy-helpers under my feet and at the time I could not figure out how to make a PR to astropy-helpers and then see the effects in astropy for testing, so I just never did it.

@cdeil
Copy link
Member

cdeil commented Jan 22, 2017

Support for the numpy docstring convention recently landed in pydocstyle:
PyCQA/pydocstyle#226

It's not released yet, but if you install the dev version, then it's possible to use already, e.g.

pydocstyle --convention=numpy --add-ignore=D410 astropy/nddata

I don't have time to clean up stuff or to help improve that tool. I just tried if for 5 min and reported one false positive issue: PyCQA/pydocstyle#230

IMO anyone that has time to work on docstring checkers should consider contributing to that tool instead of 100s of projects rolling their own.

@bsipocz
Copy link
Member Author

bsipocz commented Jan 22, 2017

Thanks @cdeil for pushing for this. I totally agree that using tools like pydocstyle is the way forward. I plan to work a bit on this on pep8 before the new release as a clean-up, but it's totally fine by me if someone is faster and beat me to it.

@bsipocz
Copy link
Member Author

bsipocz commented Jun 29, 2018

Undocumented parameters came up again as an issue (#7608 (comment)), thus I'll try to get something working by 3.1

@MSeifert04
Copy link
Contributor

MSeifert04 commented Jun 30, 2018

It would be very helpful to get this working. However in the case of #7608 the parameters are documented. 😄

@pllim pllim added the sprint label Jul 10, 2018
@pllim
Copy link
Member

pllim commented Jul 10, 2018

Since this keeps resurfacing once in a while, I added a "sprint" label in hope that we'll get to it sooner than later. 🤞

@pllim
Copy link
Member

pllim commented Oct 26, 2018

Removing milestone...

@pllim pllim removed this from the v3.1 milestone Oct 26, 2018
@bsipocz
Copy link
Member Author

bsipocz commented Oct 27, 2018

Thanks. this slipped through, though still can be addressed after feature freeze given it's documentation ;)

@pllim pllim added this to the v3.2 milestone Oct 27, 2018
@bsipocz bsipocz removed this from the v3.2 milestone Apr 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants