neuroinformatics-unit / movement

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

Add from_mmp_file function #198

Open ivanvrlg opened 1 month ago

ivanvrlg commented 1 month ago

Description

What is this PR

Why is this PR needed?

This is the first step I have taken towards including I/O functionality for MMPose, as we discussed. The PR is unfinished as no tests have been written yet, I am mainly seeking feedback.

What does this PR do?

I have included a function from_mmp_file, which loads the data from the JSON file generated by the MMPose inferencer. I am mainly seeking feedback as it is a long function and might best be contributed by breaking it down into several (maybe loading as pandas df and then converting to xarray).

References

175

How has this PR been tested?

It has not! Any feedback on how to properly write comprehensive tests for the movement package is welcome.

Is this a breaking change?

N/A

Does this PR require an update to the documentation?

Documentation should be updated to reflect the new function allowing for user input of MMPose Json files. I have included a lengthy docstring with the intention that it will explain functionality and expected input.

Checklist:

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 7.40741% with 25 lines in your changes missing coverage. Please review.

Project coverage is 95.91%. Comparing base (53a9eff) to head (f4983d7).

Files Patch % Lines
movement/io/load_poses.py 7.40% 25 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #198 +/- ## ========================================== - Coverage 99.68% 95.91% -3.77% ========================================== Files 11 11 Lines 634 661 +27 ========================================== + Hits 632 634 +2 - Misses 2 27 +25 ```

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

sonarcloud[bot] commented 3 weeks ago

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

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

See analysis details on SonarCloud