-
-
Notifications
You must be signed in to change notification settings - Fork 26.2k
[MRG+1] DOC: Add Raises Section #6199
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
Conversation
Looks good in general. This does beg the question of how to maintain this information. However, the question applies to any type of docstring, so it shouldn't deter us from merging this. You have my +1 |
In the first attempt, it felt that at automated way of finding the raised exceptions by the method would require knowing all the functions used by this method. Somewhat similar to the way parameters of a function are extracted. That said it would be really difficult IMO to take care of recursive calls and parameters passed through those calls to the functions since the exceptions raised are also dependent on them. Regarding the maintainability, probably these should be added right during the addition of the feature to the code base as a practice. And also maybe we can look at some other softwares following these kind of documentation. These are just my opinions and definitely devs are the best people to comment on this issue. Cheers. |
Ummm I don't think we can do that. The simple way would be to search for |
yes. |
Thanks for all the comments. I understand it is really an additional burden to maintain this and might also add to the lines without actually helping much. But if it is okay, will proceed on adding similarly to other function too ? Thanks. |
Please confirm with @GaelVaroquaux at #6198 before proceeding |
TypeError | ||
If the estimator is not an ``Estimator`` instance | ||
|
||
_NotFittedError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, that's private? Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry got confused with the underscore.
these are all in private functions, so you didn't add anything to the rendered docs btw .... |
Thanks but I knew that they wouldn't be rendered in the docs. I just thought that it would be helpful to better understand the util functions and also would give an idea on how feasible and useful would this extra section be. Please let me know if you feel this is not an useful addition, will proceed accordingly. |
Thanks for all the suggestion. Will close this PR for now but will push the changes to this branch in case someone wants to look at it. |
Added Raises section to
utils.validation
. This was an idea by @rvraghav93 in #6198 which seemed helpful. If feasible can do it for other modules too. Otherwise, please close the PR.