Closed roomrys closed 7 months ago
The recent updates focus on refining the triangulateSession
functionality across several files in the SLEAP project. The key adjustments include parameter optimization, enhanced method handling, and improved testing protocols. These changes streamline the process of session handling and instance management within the software, ensuring more robust and error-resistant performance.
File Path | Change Summary |
---|---|
sleap/gui/app.py , sleap/gui/commands.py |
Updated triangulateSession to use session directly, adjusted parameters, and enhanced testing. |
sleap/io/cameras.py |
Improved error handling, parameter naming, and added comprehensive tests for new functionalities. |
🐇✨ A hop, a skip, a code deploy, In the fields of SLEAP, we enjoy. Triangulate with less ado, Bugs beware, we're coming through! 🌟🐰
sleap/gui/app.py (1)
261-261: Local variable `filename` is assigned to but never usedsleap/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 --- 3141-3141: 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`tests/gui/test_commands.py (13)
75-75: Ambiguous variable name: `l` --- 82-82: Ambiguous variable name: `l` --- 227-227: Avoid equality comparisons to `True`; use `if okay:` for truth checks --- 236-236: Avoid equality comparisons to `True`; use `if okay:` for truth checks --- 244-244: Avoid equality comparisons to `True`; use `if okay:` for truth checks --- 253-253: Avoid equality comparisons to `True`; use `if okay:` for truth checks --- 265-265: Avoid equality comparisons to `True`; use `if okay:` for truth checks --- 274-274: Avoid equality comparisons to `True`; use `if okay:` for truth checks --- 281-281: Avoid equality comparisons to `True`; use `if okay:` for truth checks --- 299-299: Avoid equality comparisons to `True`; use `if okay:` for truth checks --- 360-360: Local variable `last_lf_frame` is assigned to but never used --- 368-368: Avoid equality comparisons to `True`; use `if video.backend.grayscale:` for truth checks --- 528-528: f-string without any placeholders
tests/io/test_cameras.py (2)
`451-453`: Ensure the new parameter `multiview_min_session_frame_groups` is utilized effectively in the tests. --- `597-599`: Ensure the new parameter `multiview_min_session_frame_groups` is utilized effectively in the tests.tests/gui/test_commands.py (2)
`7-7`: Added imports for `numpy` and `pytest`. Ensure these are used appropriately in the tests to avoid unnecessary imports. --- `21-21`: `TriangulateSession` added to public entities. Confirm that this is intended for external use and documented accordingly.sleap/gui/app.py (1)
`1242-1244`: Update to session management in `triangulateSession` looks good. Please ensure that the new session retrieval and passing mechanism is thoroughly tested, especially in scenarios with multiple videos or sessions.sleap/io/cameras.py (2)
`1069-1076`: Ensure correct sorting and updating of excluded views in `RecordingSession`. The changes correctly sort the `cams_to_include` based on their order in the `CameraCluster` and update the `excluded_views` accordingly. This is crucial for maintaining consistency in the views handled by the session. --- `739-741`: Add a null check before appending to the `instances` list in `InstanceGroup`. The addition of a null check before appending instances to the list is a crucial improvement that prevents potential errors from operating on null instances. This change enhances the robustness of the method.sleap/gui/commands.py (2)
`619-626`: The method `triangulateSession` has been updated to include a new `session` parameter and remove `video` and `cams_to_include` parameters. Ensure that all calls to this method are updated to pass the correct parameters. --- `3470-3486`: > :memo: **NOTE** > This review was outside the diff hunks and was mapped to the diff hunk with the greatest overlap. Original lines [3473-3497] The method `has_enough_instances` now provides default values for `instance_groups`, `frame_idx`, and `instance`. This change improves the method's flexibility and error handling by providing sensible defaults.
Attention: Patch coverage is 80.00000%
with 4 lines
in your changes are missing coverage. Please review.
Project coverage is 73.84%. Comparing base (
0d26728
) to head (e2dcd8b
).
Files | Patch % | Lines |
---|---|---|
sleap/gui/app.py | 0.00% | 2 Missing :warning: |
sleap/gui/commands.py | 81.81% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
This PR debugs the
TriangulateSession
command and adds a few fixes to the relevantInstanceGroup
andFrameGroup
methods.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
New Features
Bug Fixes
Tests