lightly-ai / lightly-ai/lightly
Unittests: refactor creation of fake datasets and embeddings
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3.8k
- Forks
- 367
- Avg merge
- 3d 22h
- Merged PRs (30d)
- 5
Description
Currently the unittests create fake datasets and embeddings at several different locations and in serveral different ways. This could be reworked to have only one function for each.
Locations:
- https://github.com/lightly-ai/lightly/blob/36e1bf05c78f928b7a75b7e253e51c00e5c79240/tests/api_workflow/test_api_workflow_upload_dataset.py#L25
- https://github.com/lightly-ai/lightly/blob/36e1bf05c78f928b7a75b7e253e51c00e5c79240/tests/api_workflow/test_api_workflow_upload_dataset.py#L45
- https://github.com/lightly-ai/lightly/blob/36e1bf05c78f928b7a75b7e253e51c00e5c79240/tests/api_workflow/test_api_workflow_upload_embeddings.py#L41
- https://github.com/lightly-ai/lightly/blob/36e1bf05c78f928b7a75b7e253e51c00e5c79240/tests/cli/test_cli_magic.py#L34
- https://github.com/lightly-ai/lightly/blob/36e1bf05c78f928b7a75b7e253e51c00e5c79240/tests/cli/test_cli_embed.py#L30
- https://github.com/lightly-ai/lightly/blob/36e1bf05c78f928b7a75b7e253e51c00e5c79240/tests/cli/test_cli_crop.py#L37
- https://github.com/lightly-ai/lightly/blob/36e1bf05c78f928b7a75b7e253e51c00e5c79240/tests/cli/test_cli_train.py#L29
- https://github.com/lightly-ai/lightly/blob/36e1bf05c78f928b7a75b7e253e51c00e5c79240/tests/cli/test_cli_upload.py#L25
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Compare the dataset and embedding setup in the listed tests under tests/api_workflow and tests/cli, starting with test_api_workflow_upload_dataset.py and test_api_workflow_upload_embeddings.py. Identify the repeated construction patterns, then run the affected unit tests. Done means the tests use one shared creation function for fake datasets and one for fake embeddings without changing their behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- testing-qa
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100