lightly-ai / lightly-ai/lightly

Update Docstrings

Open
#1,216 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

documentation enhancement good first issue
Dominant language
Python
Stars
3.8k
Forks
367
Avg merge
3d 22h
Merged PRs (30d)
5

Description

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 that 5 is the default for value in the docstring. It is already visible in the function definition. However, if the function is defined as def fun(value: int | None = None) and in the code we do: if value is None: value = 5 we should document that value is set to 5 by 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

  1. Take any file from one of the modules listed below
  2. 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.
  3. Add documentation if necessary
  4. Create a PR named "Add documentation for " and push your changes

Tasks

  • #1217
  • #1223
  • #1673
  • #1687
  • #1663
  • #1674
  • #1675
  • #1670

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Python API Docs and compare a selected uncovered module against the documented example in lightly/models/modules/memory_bank.py. Check public functions, classes, and methods against the Google Python style guide, adding only needed documentation and complete sentences. Done means the selected file is consistently documented and can be submitted in a PR named "Add documentation for ".

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.