mad-lab-fau / gaitmap

The Gait and Movement Analysis Package
https://gaitmap.readthedocs.io
Other
38 stars 2 forks source link

Improvements for the bool_array_to_start_end_array function #57

Closed livhe closed 7 months ago

livhe commented 7 months ago

The function does now check if a Series is supplied instead of a numpy array and throws an Error. It used to return just the first and last index for a Series.

Also, I think the statement "The end index is inclusive!" from the docs was misleading, because it sounds like the end index is pointing to the last element that is included in the True-region, but it points to the first False element.

AKuederle commented 7 months ago

Great! Can you invert the check? At the moment, it would only throw if users accidantly provide a series. But there are likely dozent other datatypes that would result in unexpected behaviour.

So I would suggest we check if something is a numpy array and if not throw, independent of the actual datatype. Keep in mind that isinstance checks for numpy arrays must be made against np.ndarray not np.array

codecov-commenter commented 7 months ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (4683032) 91.57% compared to head (eb9da7b) 91.55%.

Files Patch % Lines
gaitmap/utils/array_handling.py 66.66% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #57 +/- ## ========================================== - Coverage 91.57% 91.55% -0.02% ========================================== Files 85 85 Lines 4795 4798 +3 ========================================== + Hits 4391 4393 +2 - Misses 404 405 +1 ```

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