Update docstrings to match the current guideline.
See original GitHub issueMotivation
Recently, we have introduced the docstrings guideline, and it is written in wiki.
However, some docstrings do not follow it. So, here, I would like to make a list which we need to update.
List
Need to add examples
Since optuna users will use these functions and methods, they should have an example to explain how to use it. So, we need to add an Example:
section in the docstring.
- optuna.logging.get_verbosity #3066
- optuna.logging.set_verbosity #3061
- optuna.logging.enable_default_handler
- optuna.logging.disable_propagation
- optuna.study.create_study #1711
- optuna.study.load_study #1712
- optuna.study.delete_study #1741
- optuna.study.get_all_study_summaries #1742
- optuna.study.Study.optimize #1726
- optuna.study.Study.get_user_attr
- optuna.study.Study.set_user_attr
- optuna.study.Study.stop #1752
- optuna.study.Study.get_trials #1746
- optuna.multi_objective.study.MultiObjectiveStudy.optimize #1747
- optuna.multi_objective.study.create_study #1749
- optuna.multi_objective.study.load_study #1750
- …
Need to add enough description
Since optuna users will use these functions and methods, they should explain their role and usage. So, we need to add more explanation in the docstring.
- ~optuna.study.Study.get_user_attr~
- optuna.study.Study.user_attrs #1745
- optuna.study.Study.set_user_attr #1744
- …
Need to add see also
Since the following functionalities are related each other, we need to add a .. seealso::
section in the docstring.
- optuna.study.Study.get_trials <-> optuna.study.Study.trials
- …
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (7 by maintainers)
Top Results From Across the Web
Python Docstrings Tutorial : Examples & Format for Pydoc ...
See Python Docstrings. Learn about the different types of docstrings & various docstring formats like Sphinx, Numpy, and Pydoc with examples now.
Read more >Docstring update guidelines · arviz-devs/arviz Wiki - GitHub
Guidelines for updating the Parameter and return section of the API docs. Below we highlight some of the changes (based on common bad ......
Read more >Python Docstrings - GeeksforGeeks
Python documentation strings (or docstrings) provide a convenient way of associating documentation with Python modules, functions, classes, ...
Read more >flake8-docstrings - PyPI
flake8-docstrings. A simple module that adds an extension for the fantastic pydocstyle tool to flake8. Simply install this extension:
Read more >pandas docstring guide — pandas 1.5.2 documentation
A Python docstring is a string used to document a Python module, class, function or method, so programmers can understand what it does...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think we need examples for multiple objective optimization and study.stop as introduced recently in ver. 1.5. Especially how to stop study once objective function achieves certain threshold. Also, example for pruning needs more explanation: for step in range(100): # what is this for? Why do we need range(100), how to determine a range? clf.partial_fit(train_x, train_y, classes=classes)
Style varies quite a bit between example doctest code, e.g. some use single while other use double quotes for strings. Maybe we should make them consistent, following black?