Skip to content
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

Minor code cleanup #449

Merged
merged 1 commit into from
Oct 16, 2023
Merged

Minor code cleanup #449

merged 1 commit into from
Oct 16, 2023

Conversation

sergei-encord
Copy link
Collaborator

@sergei-encord sergei-encord commented Oct 16, 2023

Small code cleanup, no functional changes

Summary by CodeRabbit

### Refactor:
- Simplified the `list_collaborator_timers` function in `project.py` to directly yield results, improving readability and performance.
- Optimized the `__get_recursive_image_paths` method in `user_client.py` by replacing a loop and an if condition with a list comprehension for better efficiency.

> 🎉 With every refactor, we soar,
> Code now cleaner than before. 
> Loops and conditions take their leave,
> In simplicity, we believe! 🚀

@github-actions
Copy link

github-actions bot commented Oct 16, 2023

Image description CodeRabbit

Walkthrough

The code cleanup focused on simplifying and optimizing the existing code without altering its functionality. The changes primarily involved replacing traditional loops with more efficient constructs like yield from and list comprehensions, resulting in cleaner and more readable code.

Changes

Files Summary
encord/objects/ontology_labels_impl.py Removed unnecessary code to improve readability.
encord/project.py Simplified the list_collaborator_timers function by replacing a for loop with the yield from statement for direct result yielding.
encord/user_client.py Optimized the __get_recursive_image_paths method by replacing a loop and an if condition with a list comprehension for filtering files.

Notes

Chat with Image description CodeRabbit Bot (@coderabbitai)

  • Reply on review comments left by this bot to ask follow-up questions. A review comment is a comment on a diff or a file.
  • Invite the bot into a review comment chain by tagging @coderabbitai in a reply.

Code suggestions

  • The bot may make code suggestions, but please review them carefully before committing since the line number ranges may be misaligned.
  • You can edit the comment made by the bot and manually tweak the suggestion if it is slightly off.

Ignoring further reviews

  • Type @coderabbitai: ignore anywhere in the PR description to ignore further reviews from the bot.

@github-actions
Copy link

Unit test report

124 tests   113 ✔️  4s ⏱️
    1 suites    11 💤
    1 files        0

Results for commit a9f949d.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image description CodeRabbit

Commits Files that changed from the base of the PR and between 0db2ca3 and a9f949d commits.
Files selected (3)
  • encord/objects/ontology_labels_impl.py (2)
  • encord/project.py (1)
  • encord/user_client.py (1)
Files skipped from review due to trivial changes (3)
  • encord/objects/ontology_labels_impl.py
  • encord/project.py
  • encord/user_client.py
Review comments generated (0)
  • Review: 0
  • LGTM: 0

@sergei-encord sergei-encord merged commit 2308da3 into master Oct 16, 2023
4 checks passed
@sergei-encord sergei-encord deleted the minor-code-cleanup branch October 16, 2023 14:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant