Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add caching of mean and covar on ParticleState #686

Merged
merged 2 commits into from
Aug 8, 2022
Merged

Conversation

sdhiscocks
Copy link
Member

This has significant performance improvements, for the trade off of limiting editing to state vector and weight of the ParticleState. However, they can still be replaced with another array, clearing the cache.

Minor issue is use of standard library functools.cached_property is only available from Python 3.8, so to maintain compatibility with Python 3.7, cached_property code snippet is also included.

This has significant performance improvements, for the trade off of
limiting editing to state vector and weight of the ParticleState.
However, they can still be replaced with another array, clearing the
cache.

Minor issue is use of standard library `functools.cached_property`
is only available from Python 3.8, so to maintain compatibility with
Python 3.7, `cached_property` code snippet is also included.
@sdhiscocks sdhiscocks requested a review from a team as a code owner August 4, 2022 14:48
@sdhiscocks sdhiscocks requested review from nperree-dstl and jwragg-dstl and removed request for a team August 4, 2022 14:48
@codecov
Copy link

codecov bot commented Aug 4, 2022

Codecov Report

Merging #686 (e6b3b49) into main (bfbe6ec) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #686      +/-   ##
==========================================
+ Coverage   94.60%   94.63%   +0.02%     
==========================================
  Files         170      171       +1     
  Lines        8548     8575      +27     
  Branches     1654     1659       +5     
==========================================
+ Hits         8087     8115      +28     
+ Misses        342      339       -3     
- Partials      119      121       +2     
Flag Coverage Δ
integration 68.52% <81.81%> (+<0.01%) ⬆️
unittests 92.15% <100.00%> (+0.03%) ⬆️

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

Impacted Files Coverage Δ
stonesoup/types/_util.py 100.00% <100.00%> (ø)
stonesoup/types/state.py 99.39% <100.00%> (-0.61%) ⬇️
stonesoup/plotter.py 96.03% <0.00%> (+1.48%) ⬆️

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

@sdhiscocks sdhiscocks merged commit 78cdc99 into main Aug 8, 2022
@sdhiscocks sdhiscocks deleted the particle_cache branch August 8, 2022 11:11
@sdhiscocks sdhiscocks added breaking A breaking change that required other to modify their code and removed enhancement labels Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking A breaking change that required other to modify their code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants