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

Add MutableCachableProperty with tests #716

Open erogers-dstl opened 1 year ago

erogers-dstl commented 1 year ago

This is an alternative approach to caching (for discussion only) to Steve's recently implemented one. This has the (possible?) advantage of being able to register dependent properties that are Base object, and clear a cache if any properties of the dependent property are modified. See one of the tests for an example of this behaviour.

codecov[bot] commented 1 year ago

Codecov Report

Base: 94.58% // Head: 94.62% // Increases project coverage by +0.04% :tada:

Coverage data is based on head (1d33c3a) compared to base (ed7ffb0). Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #716 +/- ## ========================================== + Coverage 94.58% 94.62% +0.04% ========================================== Files 172 172 Lines 8841 8914 +73 Branches 1721 1731 +10 ========================================== + Hits 8362 8435 +73 Misses 346 346 Partials 133 133 ``` | Flag | Coverage Δ | | |---|---|---| | integration | `69.73% <21.91%> (-0.40%)` | :arrow_down: | | unittests | `90.77% <100.00%> (+0.07%)` | :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://codecov.io/gh/dstl/Stone-Soup/pull/716?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl) | Coverage Δ | | |---|---|---| | [stonesoup/base.py](https://codecov.io/gh/dstl/Stone-Soup/pull/716/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl#diff-c3RvbmVzb3VwL2Jhc2UucHk=) | `96.47% <100.00%> (+1.21%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=dstl)

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