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

Load bboxes dataset from VIA tracks file (3/4) #229

Open sfmig opened 1 week ago

sfmig commented 1 week ago

Rebase after #231 is merged


Description

What is this PR

Why is this PR needed? To be able to load a VIA tracks file with bounding boxes into a movement dataset.

What does this PR do?

Question: how to make mypy aware of the type transformations that take place in __attrs_post_init__? For example, the confidence array passed to ValidBboxesDataset can be None, and mypy flags that a .shape attribute is used later which None doesn't have. But mypy seems to be missing that the confidence array is populated with nans in __attrs_post_init__ if None is passed as input. Is there a nice way to fix this?

References

This PR would close #167

How has this PR been tested?

Tests pass locally and on CI.

Is this a breaking change?

No.

Does this PR require an update to the documentation?

I updated api_index.rst.

Checklist:

codecov[bot] commented 1 week ago

Codecov Report

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

Project coverage is 99.76%. Comparing base (2e406e1) to head (f8052a8).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #229 +/- ## ========================================== + Coverage 99.70% 99.76% +0.05% ========================================== Files 12 13 +1 Lines 678 840 +162 ========================================== + Hits 676 838 +162 Misses 2 2 ```

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

sonarcloud[bot] commented 1 week ago

Quality Gate Passed Quality Gate passed

Issues
7 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud