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

Change menu name to match deleting predictions beyond max instance #1790

Merged
merged 1 commit into from
May 31, 2024

Conversation

shrivaths16
Copy link
Contributor

Description

Currently we have a menu option Delete Predictions beyond Frame Limit... but it is misleading as it asks for the max instances beyond which the predictions are deleted. Hence changing the menu name to Delete Predictions beyond Max Instances... to be clear.
Also, changed the related function names to reflect the same.

This could potentially clear the confusion related to #1762

Types of changes

  • Bugfix
  • New feature
  • Refactor / Code style update (no logical changes)
  • Build / CI changes
  • Documentation Update
  • Other (explain)

Does this address any currently open issues?

[list open issues here]

Outside contributors checklist

  • Review the guidelines for contributing to this repository
  • Read and sign the CLA and add yourself to the authors list
  • Make sure you are making a pull request against the develop branch (not main). Also you should start your branch off develop
  • Add tests that prove your fix is effective or that your feature works
  • Add necessary documentation (if appropriate)

Thank you for contributing to SLEAP!

❤️

Copy link

coderabbitai bot commented May 31, 2024

Walkthrough

The recent changes in the sleap GUI application focus on renaming functionalities related to deleting predictions. Specifically, the menu item and associated actions have been updated from "delete frame limit predictions" to "delete max instance predictions." This change reflects a shift in terminology to better describe the action of deleting predictions that exceed a certain instance limit.

Changes

File(s) Change Summary
sleap/gui/app.py Updated menu item label from "delete frame limit predictions" to "delete max instance predictions".
sleap/gui/commands.py Renamed function deleteFrameLimitPredictions to deleteInstanceLimitPredictions and class DeleteFrameLimitPredictions to DeleteInstanceLimitPredictions.

Sequence Diagram(s) (Beta)

sequenceDiagram
    participant User
    participant GUI
    participant Commands

    User->>GUI: Click "delete max instance predictions"
    GUI->>Commands: Call deleteInstanceLimitPredictions()
    Commands-->>GUI: Execute deletion logic
    GUI-->>User: Update UI to reflect deletions
Loading

Poem

In the code where changes flow,
Predictions now have a new show.
From frames to instances, they shift,
A refined name gives them a lift.
Deletion's clearer, precise and neat,
Our GUI's now a greater feat!


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range and nitpick comments (6)
sleap/gui/app.py (2)

Line range hint 261-261: Remove the unused local variable filename to clean up the code.

- filename = event.mimeData().data(mime_format).data().decode()

Line range hint 261-261: Consider enhancing the dragEnterEvent method to handle multiple file types or provide feedback when an unsupported file type is dragged.

def dragEnterEvent(self, event):
    mime_format = 'application/x-qt-windows-mime;value="FileName"'
    if mime_format in event.mimeData().formats():
        # This only returns the first filename if multiple files are dropped:
        # Consider handling multiple files or providing user feedback for unsupported types
        event.acceptProposedAction()
sleap/gui/commands.py (4)

Line range hint 193-193: Undefined name MainWindow used. This might be a typo or a missing import. Please verify the correct reference or import the necessary module.


Line range hint 813-813: The local variable file_dir is assigned but never used. Consider removing this variable if it's not needed.

- file_dir = os.path.dirname(filename)

Line range hint 1687-1687: Using bare except statements is generally not recommended as they can catch unexpected exceptions and make debugging more difficult. Consider specifying the exception types that you expect to handle.

- except:
+ except Exception as e:

Also applies to: 1708-1708, 3117-3117


Line range hint 2414-2414: The f-string does not contain any placeholders, making the use of f-string unnecessary. Consider using a regular string instead.

- f"This video type {type(video.backend)} for video at index {idx} does not support grayscale yet."
+ "This video type does not support grayscale yet."

Also applies to: 2755-2755

Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between 791d2e2 and 4062624.

Files selected for processing (2)
  • sleap/gui/app.py (1 hunks)
  • sleap/gui/commands.py (2 hunks)
Additional context used
Ruff
sleap/gui/app.py

261-261: Local variable filename is assigned to but never used

sleap/gui/commands.py

193-193: Undefined name MainWindow


813-813: Local variable file_dir is assigned to but never used


1687-1687: Do not use bare except


1708-1708: Do not use bare except


2414-2414: f-string without any placeholders


2755-2755: f-string without any placeholders


3117-3117: Do not use bare except

Additional comments not posted (3)
sleap/gui/app.py (1)

787-789: The menu item and command name changes are consistent with the PR objectives and improve clarity.

sleap/gui/commands.py (2)

2441-2441: The implementation of DeleteInstanceLimitPredictions correctly handles the deletion of instances beyond a specified count threshold. This aligns with the PR's objective to rename and refactor deletion functionality.


493-495: The method deleteInstanceLimitPredictions has been correctly renamed and the associated command class DeleteInstanceLimitPredictions is used appropriately. Ensure that all references to this method and class are updated across the project.

Verification successful

The renaming of deleteFrameLimitPredictions to deleteInstanceLimitPredictions and DeleteFrameLimitPredictions to DeleteInstanceLimitPredictions has been successfully applied throughout the codebase.

  • No occurrences of the old function name deleteFrameLimitPredictions were found.
  • No occurrences of the old class name DeleteFrameLimitPredictions were found.
Scripts executed

The following scripts were executed for the analysis:


Script:

#!/bin/bash
# Description: Verify all references to `deleteInstanceLimitPredictions` and `DeleteInstanceLimitPredictions` are updated.

# Test: Search for old function and class names. Expect: No occurrences.
rg --type python $'deleteFrameLimitPredictions|DeleteFrameLimitPredictions'

Length of output: 107



Script:

#!/bin/bash
# Description: Verify all references to `deleteInstanceLimitPredictions` and `DeleteInstanceLimitPredictions` are updated.

# Test: Search for old function and class names. Expect: No occurrences.
rg 'deleteFrameLimitPredictions|DeleteFrameLimitPredictions'

Length of output: 62

Copy link

codecov bot commented May 31, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 74.06%. Comparing base (7ed1229) to head (4062624).
Report is 9 commits behind head on develop.

Files Patch % Lines
sleap/gui/commands.py 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1790      +/-   ##
===========================================
+ Coverage    73.30%   74.06%   +0.76%     
===========================================
  Files          134      135       +1     
  Lines        24087    24500     +413     
===========================================
+ Hits         17658    18147     +489     
+ Misses        6429     6353      -76     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@shrivaths16 shrivaths16 merged commit 33d0787 into develop May 31, 2024
8 checks passed
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.

2 participants