dstl / Stone-Soup

A software project to provide the target tracking community with a framework for the development and testing of tracking algorithms.
https://stonesoup.rtfd.io
MIT License
406 stars 134 forks source link

Use walrus operator to omit cases where no tracks exist in associations #1021

Closed jswright-dstl closed 4 months ago

jswright-dstl commented 4 months ago

The SIAP Rate of Track Number Change is the average rate of track number changes for true objects held by the metric manager defined on $(0, \infty]$. $$\frac{\sum{truth=0}^{max(truths)} min(\mathrm{tracks\ needed\ to\ track\ } (truth)) - 1}{\sum{truth=0}^{max(truths)}(\mathrm{total\ time\ tracked}(truth))}$$ Currently, this rate can be negative when the numerator function "min number tracks needed to track truth" is 0.

This fix excludes cases where the minimum number of tracks is zero from the numerator sum.

codecov[bot] commented 4 months ago

Codecov Report

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

Project coverage is 93.60%. Comparing base (072fb92) to head (f4d94f1). Report is 8 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1021 +/- ## ========================================== - Coverage 93.61% 93.60% -0.01% ========================================== Files 203 203 Lines 13103 13103 Branches 2673 2673 ========================================== - Hits 12266 12265 -1 Misses 590 590 - Partials 247 248 +1 ``` | [Flag](https://app.codecov.io/gh/dstl/Stone-Soup/pull/1021/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl) | Coverage Δ | | |---|---|---| | [integration](https://app.codecov.io/gh/dstl/Stone-Soup/pull/1021/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl) | `65.98% <100.00%> (+0.06%)` | :arrow_up: | | [unittests](https://app.codecov.io/gh/dstl/Stone-Soup/pull/1021/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl) | `89.25% <100.00%> (-0.01%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl#carryforward-flags-in-the-pull-request-comment) to find out more.

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