Closed roomrys closed 5 months ago
This update enhances the handling of instances within frame groups in the SLEAP project. It introduces refined logic for adding and removing instances, ensuring proper management and linking of these instances in various structures, thus improving the software's robustness and functionality in tracking scenarios.
Files | Change Summary |
---|---|
sleap/gui/commands.py sleap/io/dataset.py |
Added and refined logic for handling instances in FrameGroup , including addition, replacement, and removal of instances. |
sleap/io/cameras.py |
Refined instance handling in FrameGroup to ensure proper linking without an InstanceGroup . |
ππ Oh hooray, oh joy, let's hop and twirl, For code that's neat as a bunny's whirl. Instances join, and none shall miss, In frame groups' dance, a coder's bliss. ππΎ
sleap/gui/commands.py (11)
38-38: `itertools.permutations` imported but unused --- 38-38: `itertools.product` imported but unused --- 40-40: `typing.cast` imported but unused --- 57-57: `sleap.io.cameras.Camcorder` imported but unused --- 196-196: Undefined name `MainWindow` --- 834-834: Local variable `file_dir` is assigned to but never used --- 1708-1708: Do not use bare `except` --- 1729-1729: Do not use bare `except` --- 2466-2466: f-string without any placeholders --- 2798-2798: f-string without any placeholders --- 3161-3161: Do not use bare `except`sleap/io/cameras.py (7)
79-79: f-string without any placeholders --- 80-80: f-string without any placeholders --- 81-81: f-string without any placeholders --- 448-448: Undefined name `Skeleton` --- 601-601: Undefined name `Skeleton` --- 829-829: Do not use bare `except` --- 1003-1003: Undefined name `Labels`sleap/io/dataset.py (16)
55-55: Redefinition of unused `Callable` from line 45 --- 61-61: `h5py` imported but unused --- 69-69: Do not use bare `except` --- 70-70: `typing._ForwardRef` imported but unused --- 365-365: Do not assign a `lambda` expression, use a `def` --- 367-370: Do not assign a `lambda` expression, use a `def` --- 372-375: Do not assign a `lambda` expression, use a `def` --- 934-934: Do not compare types, use `isinstance()` --- 1484-1484: Do not compare types, use `isinstance()` --- 2389-2389: Undefined name `glob` --- 2484-2484: Avoid equality comparisons to `False`; use `if not ret:` for false checks --- 2572-2572: Avoid equality comparisons to `False`; use `if not ret:` for false checks --- 2587-2587: Undefined name `sleap` --- 2677-2677: Do not compare types, use `isinstance()` --- 2680-2680: Local variable `e` is assigned to but never used --- 2682-2682: f-string without any placeholders
sleap/io/cameras.py (1)
Line range hint `601-601`: The name `Skeleton` is undefined in this scope, which will cause a runtime error.sleap/gui/commands.py (1)
`2931-2950`: Ensure that the new instance is correctly added to the `InstanceGroup`. Please verify that the `InstanceGroup` and `FrameGroup` are correctly updated when a new instance is added. This is crucial for maintaining data integrity and ensuring that the GUI reflects the current state of the model.
Attention: Patch coverage is 29.03226%
with 22 lines
in your changes are missing coverage. Please review.
Project coverage is 73.78%. Comparing base (
8d3e232
) to head (0b3adbf
).
Files | Patch % | Lines |
---|---|---|
sleap/io/dataset.py | 25.00% | 12 Missing :warning: |
sleap/gui/commands.py | 30.76% | 9 Missing :warning: |
sleap/io/cameras.py | 50.00% | 1 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
TriangulateSession
callsframe_group.upsert_points
which should createPredictedInstance
s for anyCamcorder
s that do not already have an assignedInstance
(orPredictedIntance
). However, after triangulating, thePredictedInstance
s were not being displayed in the GUI - even though the containingInstanceGroup
appeared to have been filled in withPredictedInstance
s for each "missing" view.This PR does 3 things:
PredictedInstance
s to theLabeledFrame
PredictedInstance
s withInstance
s (when creating anInstance
from aPredictedInstance
)Instance
withPredictedInstance
(when removing anInstance
that ha an associatedPredictedInstance
)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