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
385 stars 127 forks source link

Fixed neighbour.py GNNWith2DAssignment class. #805

Closed jrai51 closed 1 year ago

jrai51 commented 1 year ago

scipy.optimize.linear_sum_assignment no longer accepts a flag to accept maximization problems. Additionally, it does not accept infinity values. This issue became prevalent in running StoneSoup's initiator/deleter tutorial, which would not work due to this change. Problem was fixed by replacing infinity values with sys.maxsize, and simply making an if statement to check if probability_flag is True, indicating a maximization problem, then just negating the matrix.

Now passes all test cases.

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.02 :tada:

Comparison is base (7fc3f44) 94.93% compared to head (44077dc) 94.95%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #805 +/- ## ========================================== + Coverage 94.93% 94.95% +0.02% ========================================== Files 184 184 Lines 10327 10332 +5 Branches 2098 2099 +1 ========================================== + Hits 9804 9811 +7 + Misses 363 362 -1 + Partials 160 159 -1 ``` | Flag | Coverage Δ | | |---|---|---| | integration | `68.72% <100.00%> (+<0.01%)` | :arrow_up: | | unittests | `90.20% <100.00%> (+0.02%)` | :arrow_up: | 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. | [Impacted Files](https://app.codecov.io/gh/dstl/Stone-Soup/pull/805?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl) | Coverage Δ | | |---|---|---| | [stonesoup/\_\_init\_\_.py](https://app.codecov.io/gh/dstl/Stone-Soup/pull/805?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl#diff-c3RvbmVzb3VwL19faW5pdF9fLnB5) | `85.71% <ø> (+2.38%)` | :arrow_up: | | [stonesoup/dataassociator/neighbour.py](https://app.codecov.io/gh/dstl/Stone-Soup/pull/805?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl#diff-c3RvbmVzb3VwL2RhdGFhc3NvY2lhdG9yL25laWdoYm91ci5weQ==) | `94.38% <100.00%> (+0.26%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/dstl/Stone-Soup/pull/805/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

jrai51 commented 1 year ago

Turns out I was using an older version of scipy rather than a newer one... Occam's Razor?