-
Notifications
You must be signed in to change notification settings - Fork 103
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
SLEAP 1.3.3 #1505
SLEAP 1.3.3 #1505
Changes from all commits
b8a37c4
cdf8cba
6eed6d9
c033f85
cf831b6
a2092f0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
# Remember the old library path for when we deactivate | ||
export SLEAP_OLD_LD_LIBRARY_PATH=$LD_LIBRARY_PATH | ||
# Help CUDA find GPUs! | ||
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
|
||
# Reset to the old library path for when deactivating the environment | ||
export LD_LIBRARY_PATH=$SLEAP_OLD_LD_LIBRARY_PATH |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,3 +46,4 @@ dependencies: | |
|
||
- pip: | ||
- "--editable=.[conda_dev]" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,20 +8,22 @@ | |
so that current frame must be redrawn). | ||
""" | ||
|
||
from qtpy import QtWidgets | ||
|
||
import attr | ||
import abc | ||
import numpy as np | ||
import logging | ||
from typing import Sequence, Union, Optional, List | ||
|
||
import attr | ||
import numpy as np | ||
from qtpy import QtWidgets | ||
from qtpy.QtWidgets import QGraphicsItem | ||
|
||
from sleap import Labels, Video | ||
from sleap.gui.widgets.video import QtVideoPlayer | ||
from sleap.nn.data.providers import VideoReader | ||
from sleap.nn.inference import VisualPredictor | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
@attr.s(auto_attribs=True) | ||
class BaseOverlay(abc.ABC): | ||
|
@@ -64,7 +66,15 @@ def remove_from_scene(self): | |
if self.items is None: | ||
return | ||
for item in self.items: | ||
self.player.scene.removeItem(item) | ||
try: | ||
self.player.scene.removeItem(item) | ||
|
||
except RuntimeError as e: # Internal C++ object (PySide2.QtWidgets.QGraphicsPathItem) already deleted. | ||
logger.debug(e) | ||
pass | ||
|
||
# Stop tracking the items after they been removed from the scene | ||
self.items = [] | ||
|
||
Comment on lines
66
to
78
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new code introduces exception handling when removing items from the scene. This is a good practice as it prevents the program from crashing due to a RuntimeError. However, it's important to ensure that this doesn't mask other potential issues. The error message suggests that the issue arises when trying to remove an item that has already been deleted. If this happens frequently, it might indicate a problem with the logic of the program. Consider investigating why these errors are occurring and whether they can be prevented. |
||
def redraw(self, video, frame_idx, *args, **kwargs): | ||
"""Remove all items from the scene before adding new items to the scene. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
""" | ||
|
||
|
||
__version__ = "1.3.2" | ||
__version__ = "1.3.3" | ||
|
||
|
||
def versions(): | ||
|
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.
The
pass
statement after logging the exception is redundant and can be removed. Python will automatically continue execution at the next statement after theexcept
block.- pass