sleap icon indicating copy to clipboard operation
sleap copied to clipboard

Add menu item for deleting instances beyond frame limit

Open shrivaths16 opened this issue 1 year ago • 2 comments

Description

Currently there is no menu option to delete predictions beyond a certain frame number. This would add some ease of use when trying to delete predictions and then re-labeling to train the model again to get different/better predictions.

This came in as a suggestion in #1762

Types of changes

  • [ ] Bugfix
  • [x] 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!

:heart:

Summary by CodeRabbit

  • New Features

    • Introduced a new menu item "Delete Predictions beyond Frame Limit..." in the label menu.
    • Added functionality to delete predictions beyond a specified frame limit.
  • Tests

    • Added a test function to ensure correct deletion of instances beyond a specified frame limit.

shrivaths16 avatar Jun 05 '24 16:06 shrivaths16

Walkthrough

A new feature has been introduced to the SLEAP GUI application, allowing users to delete predicted instances beyond a specified frame limit. This involves adding a new menu item, creating a command to handle the deletion, and implementing tests to ensure functionality.

Changes

Files Change Summary
sleap/gui/app.py Added a new menu item "Delete Predictions beyond Frame Limit..." and linked it to a new command.
sleap/gui/commands.py Added deleteFrameLimitPredictions method and DeleteFrameLimitPredictions class for frame-based deletion logic.
tests/gui/test_commands.py Introduced test test_DeleteFrameLimitPredictions to verify the new frame limit deletion functionality.
sleap/config/frame_range_form.yaml Created a new YAML file defining min_frame_idx and max_frame_idx parameters for frame indexing.
sleap/gui/dialogs/frame_range.py Added FrameRangeDialog class for user interface to select frame ranges, including methods for dynamic field updates.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GUI
    participant Commands
    participant DataHandler

    User->>GUI: Clicks "Delete Predictions beyond Frame Limit..."
    GUI->>Commands: Trigger deleteFrameLimitPredictions()
    Commands->>DataHandler: Identify and delete instances beyond frame limit
    DataHandler->>Commands: Confirm deletion
    Commands->>GUI: Update display
    GUI->>User: Show updated predictions

Possibly related PRs

  • #1790: This PR changes the menu item from "Delete Predictions beyond Frame Limit..." to "Delete Predictions beyond Max Instances...", which directly relates to the new menu item introduced in the main PR.

Poem

In SLEAP's GUI, a feature quite grand,
Deleting predictions with a swift hand.
Beyond frame limits, we clear the slate,
Bringing order, rest assured, it’s first-rate!
With tests to guide, and commands so neat,
Our label makers have tools that can't be beat!
🌟✨🐰

[!TIP] CodeRabbit's docstrings feature is now available as part of our Early Access Program! Simply use the command @coderabbitai generate docstrings to have CodeRabbit automatically generate docstrings for your pull request. We would love to hear your feedback on Discord.


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>, please review it.
    • 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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @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 using 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration 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.

coderabbitai[bot] avatar Jun 05 '24 16:06 coderabbitai[bot]

Codecov Report

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

Project coverage is 75.51%. Comparing base (7ed1229) to head (90bdee3). Report is 60 commits behind head on develop.

Files with missing lines Patch % Lines
sleap/gui/commands.py 64.70% 6 Missing :warning:
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1797      +/-   ##
===========================================
+ Coverage    73.30%   75.51%   +2.20%     
===========================================
  Files          134      133       -1     
  Lines        24087    24666     +579     
===========================================
+ Hits         17658    18627     +969     
+ Misses        6429     6039     -390     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jun 05 '24 16:06 codecov[bot]