Closed roomrys closed 7 months ago
The updates across the sleap
modules enhance data handling and serialization, particularly for RecordingSession
and InstanceGroup
classes. New attributes and methods support more detailed management of instances and frames within sessions. Changes also streamline the interaction with JSON files, improving the robustness and clarity of the codebase.
Files | Change Summary |
---|---|
.../io/cameras.py |
Extended InstanceGroup and RecordingSession with new attributes and methods for better data management. Added serialization capabilities to FrameGroup . |
.../io/dataset.py |
Updated to_dict method to include sessions key and enhanced handling of labeled frames. |
.../io/format/labels_json.py |
Modified comments for clarity and restructured session loading logic based on JSON content. |
.../io/test_cameras.py |
Updated tests to reflect changes in RecordingSession and InstanceGroup , including new dictionary handling methods. |
πβ¨ Oh hooray, oh hooray, the code's got its sway, New fields bloom like flowers in May. Frames and sessions dance in a line, With every commit, oh how we shine! Letβs hop with joy, for the code does deploy, In the land of SLEAP, where bugs dare not creep. π πβ¨
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 --- 452-452: Undefined name `Skeleton` --- 605-605: Undefined name `Skeleton` --- 832-832: 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()` --- 1454-1454: Do not compare types, use `isinstance()` --- 2360-2360: Undefined name `glob` --- 2455-2455: Avoid equality comparisons to `False`; use `if not ret:` for false checks --- 2543-2543: Avoid equality comparisons to `False`; use `if not ret:` for false checks --- 2558-2558: Undefined name `sleap` --- 2648-2648: Do not compare types, use `isinstance()` --- 2651-2651: Local variable `e` is assigned to but never used --- 2653-2653: f-string without any placeholderssleap/io/format/labels_json.py (6)
159-159: Local variable `ex` is assigned to but never used --- 229-229: Local variable `ex` is assigned to but never used --- 385-385: Do not compare types, use `isinstance()` --- 410-410: Do not use bare `except` --- 414-414: Do not use bare `except` --- 434-434: Local variable `new_skel` is assigned to but never used
tests/io/test_cameras.py (8)
`138-138`: Ensure the new parameter `multiview_min_session_labels` is properly integrated and used within the test function. --- `216-224`: The method `to_session_dict` has been updated to include `labeled_frame_to_idx`. Verify that this change integrates well with the existing logic and that all dependencies are correctly handled. --- `241-246`: The method `from_session_dict` now includes `labeled_frames_list`. Ensure that this addition is compatible with the existing deserialization logic and that all related data structures are correctly updated. --- `267-272`: The `make_cattr` method has been enhanced to handle `labeled_frames_list` and `labeled_frame_to_idx`. Confirm that these changes are correctly implemented and that they do not introduce any regressions. --- `378-378`: The method `from_instance_by_camcorder_dict` has been updated. Ensure that the changes are correctly implemented and that they integrate well with the existing logic. --- `396-404`: The `to_dict` method in the `InstanceGroup` class has been updated to handle `instance_to_lf_and_inst_idx`. Verify that this change integrates well with the existing logic and that all dependencies are correctly handled. --- `521-530`: The `to_dict` method in the `FrameGroup` class has been updated to handle `labeled_frame_to_idx`. Verify that this change integrates well with the existing logic and that all dependencies are correctly handled. --- `531-536`: The `from_dict` method now includes `labeled_frames_list`. Ensure that this addition is compatible with the existing deserialization logic and that all related data structures are correctly updated.sleap/io/format/labels_json.py (3)
`392-392`: Update the comment for clarity and consistency. Consider changing to "Don't break if the JSON doesn't include tracks." --- `417-417`: Update the comment for clarity and consistency. Consider changing to "If we're given a Labels object to match, use its objects when they match." --- `540-555`: Verify the restructuring of code related to loading `RecordingSession`s based on the presence of "sessions" in the input data. Ensure that this change integrates well with the existing logic and that all dependencies are correctly handled.
Attention: Patch coverage is 72.22222%
with 25 lines
in your changes are missing coverage. Please review.
Project coverage is 73.35%. Comparing base (
712fc70
) to head (d9eafa7
).
Files | Patch % | Lines |
---|---|---|
sleap/io/cameras.py | 73.07% | 21 Missing :warning: |
sleap/io/format/labels_json.py | 55.55% | 4 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
This PR aims to serialize/deserialize
FrameGroup
s (and consequentlyInstanceGroup
s).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
InstanceGroup
andFrameGroup
classes for improved clarity and functionality.