Skip to content

feat: add basic trajectory metrics#943

Open
goktugsina wants to merge 2 commits intoneuroinformatics-unit:mainfrom
goktugsina:trajectory-metrics
Open

feat: add basic trajectory metrics#943
goktugsina wants to merge 2 commits intoneuroinformatics-unit:mainfrom
goktugsina:trajectory-metrics

Conversation

@goktugsina
Copy link
Copy Markdown

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?
Currently, the kinematics module provides several metrics such as distances and kinetic energy, but it lacks basic trajectory-level summary metrics. Adding trajectory length and trajectory variance helps users quickly quantify motion patterns and provides a simple foundation for further analysis.

What does this PR do?
Adds a new module: trajectory_metrics.py
Implements:
trajectory_length: computes total path length of a trajectory
trajectory_variance: computes overall spatial variance of the trajectory
Exposes the new functions in kinematics/init.py
Adds a unit test for trajectory_length

References

No related issues found. This is an initial contribution to extend trajectory analysis capabilities.

How has this PR been tested?

Added a unit test (test_trajectory_length) to verify correctness
Tested locally by running the test suite
Verified that existing functionality remains unchanged (no modifications to existing logic)

Is this a breaking change?

No. This PR only adds new functionality and does not modify any existing behavior.

Does this PR require an update to the documentation?

No major documentation changes are required, as this is a small additive feature. However, documentation can be extended in the future to include examples of trajectory metrics usage.

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

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.

1 participant