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

multi_update #28

Merged
merged 9 commits into from
Oct 25, 2020
Merged

multi_update #28

merged 9 commits into from
Oct 25, 2020

Conversation

eagmon
Copy link
Member

@eagmon eagmon commented Oct 18, 2020

This PR corrects a pretty serious oversight that I discovered when migrating wcecoli. If a process has multiple ports that share a variable name, and those ports are plugged into the same store through a composite, then the process could be updating the variable multiple times in a single update. Previously, inverse_topology in experiment used deep_merge, which would merge those updates, arbitrarily overwriting one with the other. We needed the option for both updates to be applied.

To fix this, inverse_topology now uses a function called deep_merge_multi_update. This is like deep_merge, but if a value is already present under a given key, it gets added to a list under the special key '_multi_update'. The apply_update method looks for this special key, and will apply all updates under it to the same store.

@eagmon eagmon merged commit e7a7ad6 into master Oct 25, 2020
@eagmon eagmon deleted the inverse_topology_merge branch October 25, 2020 23:13
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 this pull request may close these issues.

None yet

1 participant