Add macro and functions for named tuple updates #440
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
This file introduces a macro for updating named tuples and a deep merge function to handle nested updates. It also includes a pretty print function for displaying named tuples.
I wrote this macro for my personal use, but because I use DrWatson in all my scientific projects, and I believe that this is a valuable tool for anyone working with nested tuples, I think it would be nice to have it here! I added tests and a an example case (in the test file) that you can add in the doc.
The idea is to use it to update experiment configurations within loops:
It works like this:
There is also an in-place
@update!
version