sleap icon indicating copy to clipboard operation
sleap copied to clipboard

Create new instances away from copied instances

Open Arthurmayo opened this issue 1 year ago • 2 comments

Description

A new instance is created 10 pixels away from the instance it is copying from. This allows for faster labeling.

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

  • Bug Fixes
    • Adjusted the positioning logic for predicted instances to ensure accurate x and y coordinates.
    • Updated video widget logic to make all nodes selectable, enhancing usability and consistency.

Arthurmayo avatar Jun 20 '24 23:06 Arthurmayo

Walkthrough

The changes enhance components within the SLEAP's graphical user interface functionalities. Adjustments to set_visible_nodes in commands.py refine the coordinate handling for visible nodes. Meanwhile, a modification in the initialization function of video.py ensures that the selectable attribute is persistently set to true, simplifying conditional logic.

Changes

File Change Summary
sleap/gui/commands.py Adjusted set_visible_nodes to modify x and y coordinates based on conditions for PredictedInstance.
sleap/gui/widgets/video.py Changed __init__ function to set self.selectable to True unconditionally.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant GUI
    participant set_visible_nodes
    User->>GUI: Initiate node visibility setting
    GUI->>set_visible_nodes: Call set_visible_nodes with instances
    Note over set_visible_nodes: Adjust x, y based on conditions <br> for PredictedInstance
    set_visible_nodes-->>GUI: Return adjusted node visibility
    GUI-->>User: Display updated nodes

    Note over User, GUI: Setting selectable attribute in video
    User->>GUI: Initiate video widget creation
    GUI->>VideoWidget: Call __init__
    Note over VideoWidget: Set self.selectable to True
    VideoWidget-->>GUI: Completed instantiation
    GUI-->>User: Display video widget

Poem

In a world of nodes that gleam and glow,
Coordinates align in a perfect row,
Widgets now selectable at every twist,
Simplicity and clarity—none can resist.
Through the codes, updates come to light,
Making our GUI a seamless delight. 🌟🐰


[!TIP]

Early access features: enabled

We are currently testing the following features in early access:

  • OpenAI gpt-4o model for code reviews and chat: OpenAI claims that this model is better at understanding and generating code than the previous models. We seek your feedback over the next few weeks before making it generally available.

Note:

  • You can enable or disable early access features from the CodeRabbit UI or by updating the CodeRabbit configuration file.
  • Please join our Discord Community to provide feedback and report issues.
  • OSS projects are always opted into early access features.

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.

coderabbitai[bot] avatar Jun 20 '24 23:06 coderabbitai[bot]

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 74.10%. Comparing base (7ed1229) to head (0afedc1). Report is 18 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1816      +/-   ##
===========================================
+ Coverage    73.30%   74.10%   +0.79%     
===========================================
  Files          134      135       +1     
  Lines        24087    24521     +434     
===========================================
+ Hits         17658    18171     +513     
+ Misses        6429     6350      -79     

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

codecov[bot] avatar Jul 01 '24 18:07 codecov[bot]

Closing this PR in favor of:

  • #1859

roomrys avatar Jul 12 '24 13:07 roomrys