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

kalman smoother deep copy - unpickable, loose reference #1125

Open
ppgp-gmv opened this issue Feb 20, 2025 · 2 comments · May be fixed by #1126
Open

kalman smoother deep copy - unpickable, loose reference #1125

ppgp-gmv opened this issue Feb 20, 2025 · 2 comments · May be fixed by #1126

Comments

@ppgp-gmv
Copy link

Stone Soup v1.4, smoother/kalman.py line 202
smoothed_track = copy.deepcopy(track, {id(track.states): smoothed_states})
Creates a deep copy, with two issues:

  • Cannot deal with unpickable objects (e.g. metadata contains unpickable objects used in Detection class to keep track of detections and the observations that generated the detection for subsequent processing...)
  • Looses "pass by reference" functionality.

The first can be worked around, the second aswell but seems a bit more inconvenient and prone to raise errors in postprocessing activities for instance

@sdhiscocks
Copy link
Member

Thanks for the report @ppgp-gmv. Yeah, a shallow copy is probably preferable, and that would solve the issues you've raised?

@ppgp-gmv
Copy link
Author

Yes, I was discussing this issue with Lyudmil, and proposed that same approach (which I am going to implement for now overloading)

sdhiscocks added a commit that referenced this issue Feb 20, 2025
@sdhiscocks sdhiscocks linked a pull request Feb 20, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants