Closed roomrys closed 6 months ago
The updates primarily enhance the Camera
class by introducing a new parameter to improve data handling, and refining method functionalities. Additionally, the testing suite has been expanded to accommodate new features and ensure robustness, including the introduction of optional parameters and testing for new logic in instance and frame management.
File Path | Change Summary |
---|---|
sleap/io/cameras.py |
- New invisible_as_nan parameter in numpy method- Renamed parameter in remove_instance_group - Placeholder for _remove_camera method |
tests/io/test_cameras.py |
- Updated imports - Expanded create_instance_group with optional name- Enhanced tests for instance and frame group handling |
🐇💻🌟
In the land of code and frame,
A little rabbit made its claim.
Tweaks and tests, a dance of sorts,
Ensuring no bug thwarts its forts.
Celebrate, for changes are here,
CodeRabbit hops and spreads cheer!
🎉🐾
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` --- 605-605: Undefined name `Skeleton` --- 833-833: Do not use bare `except` --- 1007-1007: Undefined name `Labels`
tests/io/test_cameras.py (16)
`15-15`: Updated imports to include `PredictedInstance`. This change aligns with the new functionalities being tested that involve `PredictedInstance`. --- `401-401`: Added optional `name` parameter to `create_instance_group`. This addition enhances flexibility by allowing the specification of a name during instance group creation, which is useful for more descriptive testing scenarios. --- `416-418`: Handle default naming within `create_instance_group`. Setting a default name when none is provided is a good practice for ensuring that every instance group has a meaningful identifier, especially in testing contexts. --- `467-471`: Test for expected failure when creating a dummy instance. This test ensures that the method behaves as expected under erroneous conditions, which is crucial for robustness. --- `490-500`: Testing properties of a dummy instance. These assertions are important for verifying that the dummy instances are correctly initialized with expected default values. --- `501-507`: Testing the `name` property and its setter. These tests validate the functionality of getting and setting the name of an instance group, which is important for ensuring data integrity and correct behavior in user interfaces or logs. --- `508-517`: Testing `set_name` method with name registry. This test checks the behavior of the `set_name` method, ensuring it interacts correctly with a name registry to avoid duplicates, which is crucial for maintaining uniqueness constraints. --- `518-523`: Testing generation of a unique name. This test ensures that the method for generating a unique name functions correctly, which is essential for avoiding conflicts in identifiers within the system. --- `620-625`: Testing the `update_points` method. This test verifies that the `update_points` method correctly updates the points in an instance group, which is crucial for ensuring data consistency after modifications. --- `626-643`: Testing methods for adding, replacing, and removing instances. These tests are vital for ensuring that instance management within groups is robust and error-free, particularly in scenarios involving complex data manipulations. --- `747-748`: Testing setter for `cams_to_include` with error handling. This test ensures that the system correctly handles invalid assignments to `cams_to_include`, which is important for maintaining the integrity of the data structure. --- `762-767`: Testing retrieval of an instance group based on an instance. This test checks that the method for retrieving the instance group of a given instance is functioning correctly, which is crucial for navigating complex data relationships within the system. --- `768-784`: Testing the setter and removal methods for instance groups. These tests ensure that instance groups can be dynamically managed within a frame group, which is essential for applications that require runtime modifications to data structures. --- `811-823`: Testing renaming of instance groups within a frame group. This test verifies that renaming functionality is properly managed and integrated within the frame group, ensuring consistency and correctness of data. --- `824-848`: Testing methods related to labeled frame management. These tests are crucial for ensuring that operations related to labeled frames are handled correctly, particularly in contexts where accurate tracking and management of video data are required. --- `849-855`: Testing the creation and addition of labeled frames. This test ensures that labeled frames can be created and correctly integrated into the system, which is vital for maintaining data integrity and usability in video analysis applications.sleap/io/cameras.py (2)
Line range hint `554-588`: The addition of the `invisible_as_nan` parameter in the `numpy` method enhances flexibility in handling invisible points. However, ensure that all calls to this method in the codebase are updated to handle this new parameter. --- Line range hint `554-588`: The implementation of handling invisible points as NaN in the `numpy` method is correctly done and enhances data handling.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 74.00%. Comparing base (
507eefa
) to head (3adb85e
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
This PR adds more tests for
InstanceGroup
andFrameGroup
classes.Types of changes
Does this address any currently open issues?
[list open issues here]
Outside contributors checklist
Thank you for contributing to SLEAP!
:heart: