Closed roomrys closed 4 weeks ago
The changes involve a restructuring of the structure_instances_list
function in the sleap/instance.py
file. A new helper function, structure_instance
, has been introduced to handle the logic for processing individual instance data. This refactor isolates the handling of the "score" key and the from_predicted
attribute, enhancing code clarity and maintainability. Additionally, some commented-out code has been removed to simplify the structure hook registration process.
Files | Change Summary |
---|---|
sleap/instance.py |
Refactored structure_instances_list function; added structure_instance helper function to handle instance data logic. Removed commented-out code related to ForwardRef for PredictedInstance . |
🐰 In the meadow, bright and free,
Changes dance like leaves on a tree.
With structure clear and logic bright,
We hop along, hearts full of delight!
Code so tidy, a joyful sight,
Let’s celebrate with all our might! 🌼✨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 75.31%. Comparing base (
7ed1229
) to head (8844c95
). Report is 40 commits behind head on develop.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Description
In a downstream branch, when unpinning the version of
cattrs
, the structuringInstance
s with theInstance.from_predicted
notNone
breaks.In this PR, we manually handle the structuring of the
Instance.from_predicted
attribute. Previously, we used theForwardRef
to help structure this attribute, but that is no longer needed.Types of changes
Does this address any currently open issues?
1841
Outside contributors checklist
Thank you for contributing to SLEAP!
:heart:
Summary by CodeRabbit
New Features
Refactor
Chores