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
400 stars 131 forks source link

Standardise clearable cached properties on Stone Soup Base/Property #711

Closed sdhiscocks closed 1 year ago

sdhiscocks commented 1 year ago

This has required some resequencing of the BaseMeta class due to modifying namespace which needs to be done before class initialisation, but actual change only minor:

https://github.com/dstl/Stone-Soup/blob/52a5de960ca92b34c40cbfc99e93512cbb3577be/stonesoup/base.py#L294-L299

Caching of properties which automatically clear when replacing (not modifying, as mutable case isn't covered) can now ben used more easily speed tracking with large number of states (tracks/detections).

Documentation is auto generate with a note for each property to make clear which are cached and which variables affect them.

codecov[bot] commented 1 year ago

Codecov Report

Merging #711 (1a3bf09) into main (5276c1b) will decrease coverage by 0.01%. The diff coverage is 97.50%.

@@            Coverage Diff             @@
##             main     #711      +/-   ##
==========================================
- Coverage   94.62%   94.61%   -0.02%     
==========================================
  Files         172      172              
  Lines        8845     8844       -1     
  Branches     1714     1720       +6     
==========================================
- Hits         8370     8368       -2     
  Misses        343      343              
- Partials      132      133       +1     
Flag Coverage Δ
integration 70.40% <90.00%> (+0.03%) :arrow_up:
unittests 90.78% <97.50%> (-0.02%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
stonesoup/_util.py 100.00% <ø> (ø)
stonesoup/base.py 95.02% <95.74%> (-0.91%) :arrow_down:
stonesoup/models/measurement/nonlinear.py 98.93% <100.00%> (-0.02%) :arrow_down:
stonesoup/types/state.py 100.00% <100.00%> (+0.56%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.