-
Notifications
You must be signed in to change notification settings - Fork 65
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
Add a Raises:
section in docstrings where needed
#192
Comments
BTW, shouldn't we add https://pypi.org/project/flake8-docstrings/ to CI ? I tested it locally and the results were... kinda wild... |
@LaurentAjdnik , note the last sentence of that link you sent me:
Most errors we raise come exactly from violations of the API specified in the docstring, which is why they are not documented in the docstrings. Nonetheless, there can still be raised errors out there that should be documented and that we missed - if you find any of those, feel free to open a PR adding the respective |
This is a great idea, though it needs some fine-tuning. I'll open a separate issue on it. |
Honestly, this sentence does not make much sense to me. What exactly is a "violation of the API" ? And what is not ?
While working on #157, I counted 92 From the list I pasted in that issue, can you give me a few examples of what would be, with certainty:
Right now, I feel like pretty much everything, except |
Strictly speaking you're right. Every time we raise a ValueError because a value is, for example, out of range, and we did not specify this range in the docstring, then it's not a violation of the API. However, there are times when the range is implicit (e.g. when we ask for a So yeah, I would agree with you that generally, outside of That being said, if you feel the need to attach a |
@LaurentAjdnik is it okay if I close this issue? |
@HGSilveri: Shall we open this specific issue? I agree there would be some (= a lot of?...) fine-tuning before the results are satisfying. More generally, I think there are places where we could/should add somes |
@LaurentAjdnik Actually, I already took care of that one (see #193 and #194).
Alright, I'll leave it open. Do you want me to assign you then? |
As specified in https://google.github.io/styleguide/pyguide.html#doc-function-raises.
Only two functions (in
simresults.py
) currently have such a section, whereas so many of them can raise Errors.The text was updated successfully, but these errors were encountered: