-
Notifications
You must be signed in to change notification settings - Fork 100
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
All instances are always selectable #1817
base: develop
Are you sure you want to change the base?
All instances are always selectable #1817
Conversation
WalkthroughThe recent change in Changes
Poem
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? TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this 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 (4)
sleap/gui/widgets/video.py (4)
Line range hint
306-306
: Avoid using bareexcept
statements as they can catch unexpected exceptions and make debugging harder.- except: + except Exception as e: + # Handle specific exceptions or log error
Line range hint
970-970
: The loop control variableidx
is not used within the loop body and can be replaced with_
.- for i, instance in enumerate(labeled_frame.instances_to_show): + for _i, instance in enumerate(labeled_frame.instances_to_show):
Line range hint
1169-1172
: Consider usingcontextlib.suppress
for a cleaner approach to handling exceptions where the action is to pass.- try: - child.wheelEvent(event) - except TypeError: - pass + from contextlib import suppress + with suppress(TypeError): + child.wheelEvent(event)
Line range hint
1470-1470
: The variablein_bounds
is assigned but never used, which can be removed to clean up the code.- in_bounds = True - if (x > w) or (x < 0) or (y > h) or (y < 0): - in_bounds = False + if (x > w) or (x < 0) or (y > h) or (y < 0):
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- sleap/gui/widgets/video.py (1 hunks)
Additional context used
Ruff
sleap/gui/widgets/video.py
27-27: Module level import not at top of file (E402)
28-28: Module level import not at top of file (E402)
29-29: Module level import not at top of file (E402)
30-30: Module level import not at top of file (E402)
32-32: Module level import not at top of file (E402)
33-33: Module level import not at top of file (E402)
34-34: Module level import not at top of file (E402)
35-35: Module level import not at top of file (E402)
36-51: Module level import not at top of file (E402)
52-65: Module level import not at top of file (E402)
67-67: Module level import not at top of file (E402)
68-68: Module level import not at top of file (E402)
69-69: Module level import not at top of file (E402)
70-70: Module level import not at top of file (E402)
71-71: Module level import not at top of file (E402)
72-72: Module level import not at top of file (E402)
73-73: Module level import not at top of file (E402)
74-74: Module level import not at top of file (E402)
75-75: Module level import not at top of file (E402)
110-110: Use
super()
instead ofsuper(__class__, self)
(UP008)Remove
__super__
parameters
181-182: Use a single
if
statement instead of nestedif
statements (SIM102)Combine
if
statements usingand
214-214: Use
super()
instead ofsuper(__class__, self)
(UP008)Remove
__super__
parameters
306-306: Do not use bare
except
(E722)
970-970: Loop control variable
idx
not used within loop body (B007)Rename unused
idx
to_idx
1010-1011: Use a single
if
statement instead of nestedif
statements (SIM102)Combine
if
statements usingand
1139-1140: Use a single
if
statement instead of nestedif
statements (SIM102)Combine
if
statements usingand
1169-1172: Use
contextlib.suppress(TypeError)
instead oftry
-except
-pass
(SIM105)Replace with
contextlib.suppress(TypeError)
1209-1209: Use
super()
instead ofsuper(__class__, self)
(UP008)Remove
__super__
parameters
1209-1209: Star-arg unpacking after a keyword argument is strongly discouraged (B026)
1324-1324: Use
super()
instead ofsuper(__class__, self)
(UP008)Remove
__super__
parameters
1390-1390: Use
super()
instead ofsuper(__class__, self)
(UP008)Remove
__super__
parameters
1396-1396: Star-arg unpacking after a keyword argument is strongly discouraged (B026)
1470-1470: Local variable
in_bounds
is assigned to but never used (F841)Remove assignment to unused variable
in_bounds
1543-1543: Use
super()
instead ofsuper(__class__, self)
(UP008)Remove
__super__
parameters
1567-1567: Use
super()
instead ofsuper(__class__, self)
(UP008)Remove
__super__
parameters
1582-1582: Use
super()
instead ofsuper(__class__, self)
(UP008)Remove
__super__
parameters
1629-1629: Use
super()
instead ofsuper(__class__, self)
(UP008)Remove
__super__
parameters
1632-1632: Star-arg unpacking after a keyword argument is strongly discouraged (B026)
1780-1780: Use
super()
instead ofsuper(__class__, self)
(UP008)Remove
__super__
parameters
1965-1965: Avoid extraneous parentheses (UP034)
Remove extraneous parentheses
1965-1965: Avoid extraneous parentheses (UP034)
Remove extraneous parentheses
1968-1968: Avoid extraneous parentheses (UP034)
Remove extraneous parentheses
1968-1968: Avoid extraneous parentheses (UP034)
Remove extraneous parentheses
2278-2278: Use
super()
instead ofsuper(__class__, self)
(UP008)Remove
__super__
parameters
2283-2283: Use
super()
instead ofsuper(__class__, self)
(UP008)Remove
__super__
parameters
2300-2300: Use
super()
instead ofsuper(__class__, self)
(UP008)Remove
__super__
parameters
2344-2344: Loop control variable
i
not used within loop body (B007)Rename unused
i
to_i
Additional comments not posted (1)
sleap/gui/widgets/video.py (1)
1790-1790
: The change ensures that all instances are always selectable, aligning with the PR's goal. This is a simple yet effective fix for the issue where non-colored predicted instances were not selectable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should not be movable. Ensure on-click functionality to create Instance from PredictedInstance still works.
Description
Predicted instances were not selectable if they were not colored. This fix allows all instances to always be selectable by the user.
Types of changes
Does this address any currently open issues?
[list open issues here]
Outside contributors checklist
Thank you for contributing to SLEAP!
❤️
Summary by CodeRabbit