feat: add compute_polarization() to collective behavior metrics#875
Draft
khan-u wants to merge 1 commit intoneuroinformatics-unit:mainfrom
Draft
feat: add compute_polarization() to collective behavior metrics#875khan-u wants to merge 1 commit intoneuroinformatics-unit:mainfrom
khan-u wants to merge 1 commit intoneuroinformatics-unit:mainfrom
Conversation
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
What is this PR
Why is this PR needed?
Movement currently lacks collective behavior metrics for analyzing multi-individual tracking data. Polarization is a fundamental metric for measuring group alignment, widely used in collective behavior studies of fish schools, bird flocks, and other animal groups.
What does this PR do?
Adds
compute_polarization()function that measures how aligned the heading directions of multiple individuals are. Returns values from 0 (random orientations) to 1 (perfectly aligned).References
Partial implementation of #873 (adds
compute_polarization)How has this PR been tested?
tests/test_unit/test_kinematics/test_collective.pycollective.pyhas 97% test coverageIs this a breaking change?
No. This adds a new function without modifying existing functionality.
Does this PR require an update to the documentation?
API documentation will be auto-generated from docstrings. No manual documentation update required for this PR.
Checklist: