Closed roomrys closed 1 year ago
This update enhances the robustness of the SLEAP GUI overlay system. It introduces better error handling when removing items from the scene, and improves tracking logic to ensure items are untracked post-removal.
File | Summary |
---|---|
.../sleap/gui/overlays/base.py |
Introduced a logger for improved debugging. Added exception handling to manage potential RuntimeError during item removal from the scene. Updated remove_from_scene method to cease tracking of items once removed. |
🐇💻
In the land of code where the shadows lie, A rabbit hopped in, with a twinkle in its eye. With a tap and a click, and a debug log, He fixed the errors hidden in the fog. Now the items vanish without a trace, In the GUI's gentle embrace. 🎉
Description
In making some changes to the removal of overlays in #1421 (sub-PR: #1435), we reintroduced an error:
This is likely due to already removing the items in the overlay, but still keeping track of these items and then trying to remove them again. Even with this PR, if we enable
DEBUG
logging, then we will see that there are already deleted items trying to be removed.This PR adds a
try except
around the item removal and removals all items from the tracked list of items after deleting them from the scene.Types of changes
Does this address any currently open issues?
[list open issues here]
Outside contributors checklist
Thank you for contributing to SLEAP!
:heart:
Summary by CodeRabbit
remove_from_scene
method logic for better tracking of items, improving overall performance and consistency within the application.