Skip to content

Conversation

Priyam12345-cloud
Copy link

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?

This PR adds functionality to handle pose estimation data for individuals with heterogeneous keypoints—an essential capability for datasets involving different animal subjects with varying anatomy or tracking configurations. It also adds an example to demonstrate this functionality using a real-world SLEAP dataset.

What does this PR do?

  • Introduces Individual and Scene classes to manage pose data with non-uniform keypoints.
  • Adds logic to extract common keypoints across individuals and query specific keypoints across all individuals who share them.
  • Provides an example script: examples/test_scene_with_real_data.py, which uses real sample data to demonstrate and test the implemented functionality.

References

How has this PR been tested?

  • Added a script in examples/ that loads sample SLEAP data (SLEAP_three-mice_Aeon_proofread.analysis.h5), creates multiple Individual objects, and constructs a Scene to validate common keypoint handling.
  • The script prints individual names and common keypoints, serving as a sanity check for the heterogeneous keypoint logic.
  • The code has been verified with pre-commit (ruff, mypy, codespell, check-manifest) and passes all checks.

Is this a breaking change?

  • No breaking changes. This PR introduces new functionality in a backward-compatible manner.

Does this PR require an update to the documentation?

  • Yes. A section documenting the Individual and Scene classes, along with a usage example, should be added under the relevant module.

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality (via examples/test_scene_with_real_data.py)
  • The documentation has been updated to reflect any changes (README/example section added)
  • The code has been formatted with pre-commit

Copy link

sonarqubecloud bot commented Apr 5, 2025

Copy link

codecov bot commented Apr 9, 2025

Codecov Report

Attention: Patch coverage is 61.29032% with 12 lines in your changes missing coverage. Please review.

Project coverage is 99.24%. Comparing base (a87156f) to head (c3a300d).
Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
movement/data/heterogeneous_keypoints.py 60.00% 12 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #543      +/-   ##
==========================================
- Coverage   99.87%   99.24%   -0.64%     
==========================================
  Files          28       30       +2     
  Lines        1559     1580      +21     
==========================================
+ Hits         1557     1568      +11     
- Misses          2       12      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle the case where not all individuals have the same keypoints.

1 participant