neuroinformatics-unit / movement

Python tools for analysing body movements across space and time
http://movement.neuroinformatics.dev
BSD 3-Clause "New" or "Revised" License
96 stars 8 forks source link

Refactor accessor to provide methods instead of properties #174

Closed lochhh closed 4 months ago

lochhh commented 4 months ago

Description

What is this PR

Why is this PR needed? This PR closes #162.

What does this PR do? This PR refactors the MoveAccessor by replacing the kinematic property accessors with "convenience" compute methods, which allow users to compute kinematic variables of a Dataset, for instance, by calling ds.move.compute_velocity(). It does so by overriding the __getattr__ method to "forward" method calls to the relevant modules. Atm, it only calls compute_ methods implemented in the kinematics module, but this can be expanded upon for other modules as needed.

References

162

How has this PR been tested?

Tests have been updated accordingly.

Does this PR require an update to the documentation?

The compute kinematics example has been updated accordingly.

Checklist:

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.66%. Comparing base (86b1d34) to head (6d6d8cb).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #174 +/- ## ========================================== - Coverage 99.67% 99.66% -0.02% ========================================== Files 10 10 Lines 619 591 -28 ========================================== - Hits 617 589 -28 Misses 2 2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sonarcloud[bot] commented 4 months ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud