Update Docstrings
Description
Go through all PIP modules and make sure that the docstrings are consistently formatted and complete.
- We only care about public functions/classes/methods for now (things that are in the Python API Docs).
- We don't care about outdated/deprecated modules such as active_learning and the high level models.
This is an example of a well documented file: https://github.com/lightly-ai/lightly/blob/master/lightly/models/modules/memory_bank.py
When updating docstrings or comments keep the following in mind:
- Follow the google python styleguide: https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings
- Do not document default values if they are part of the function definition. E.g. if the function is defined as:
def fun(value: int = 5)there is no need to document that5is the default forvaluein the docstring. It is already visible in the function definition. However, if the function is defined asdef fun(value: int | None = None)and in the code we do:if value is None: value = 5we should document that value is set to5by default as this is not evident from the function definition. - Make full sentences when writing comments
- Do not add comments if it is evident from the code what is happening
How to work on this issue
- Take any file from one of the modules listed below
- Make sure that all public functions/classes/methods are well documented. You can also split the work into multiple PRs for files with many functions or classes with many methods.
- Add documentation if necessary
- Create a PR named "Add documentation for
" and push your changes
Tasks
- [ ] #1217
- [x] #1223
- [x] #1673
- [x] #1687
- [x] #1663
- [ ] #1674
- [x] #1675
- [x] #1670
@guarin Is this issue resolved? If not then please assign it to me. I would love to work on this.
Hi and thanks for working on this! Could you quickly indicate on which files you would work?
lightly/models/utils.py
Awesome, created the issue for you: https://github.com/lightly-ai/lightly/issues/1663 If you comment on it I can assign it to you.
Please create a issue for Cleanup docstrings in lightly/embedding subpackage and assign it to me. @guarin
Please create a issue for Cleanup docstrings in lightly/embedding subpackage and assign it to me. @guarin
Created the issue, if you comment on it I'll be able to assign it to you
@guarin I want to work on lightly/loss subpackage, lightly/data subpackage, and lightly/utils subpackage. Please assign it to me.
@ayush22iitbhu I created the issue, I can assign it to you if you comment on it. https://github.com/lightly-ai/lightly/issues/1673
I'll keep the others unassigned for now.
@guarin I want to work on lightly/models/modules subpackage. Can you assign it to me.
Awesome, can you comment on the issue https://github.com/lightly-ai/lightly/issues/1687 then I can assign it to you