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

Remove unnecessary deep copies #27

Open
THargreaves opened this issue Jan 9, 2025 · 0 comments
Open

Remove unnecessary deep copies #27

THargreaves opened this issue Jan 9, 2025 · 0 comments

Comments

@THargreaves
Copy link
Collaborator

There are currently quite a few deep copies in the code base that were added when debugging the initial code implementations in quite a conservation way.

In eaa9f40, I've removed those that are definitely safe to remove. All tests still pass.

Some deepcopies are likely best remaining, such as those used in callbacks.

Whether others can be removed largely comes down to how much in-place operations we want to allow. Whatever we do, I think we need to decide on a consistent rule.

The main thing we need to watch out for is particles.filtered pointing to particles.proposed and then making in-place changes to filtered which will change the proposed particles that still need to be kept around for the call back.

An alternative way around this would be have to have multiple callback opportunities, one after predict one after update so you know you have the correct distribution at that time (this would involve removing intermediate)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant