-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Experiments: allow setting of list parameters #4769
Experiments: allow setting of list parameters #4769
Conversation
Check if dict is Mapping or list before using .get()
@sjawhar thanks for identifying this issue and for the PR! This looks like a great start, and worked for me in a test project. Don't worry about cleaning up the For a test case, a modified version of
should work. Your test case will just need to generate a
The test stage we use just copies a params into a metrics file, so after calling |
OK, test added. Thanks for pointing me to the right spot, that made it super easy for me π |
1953822
to
fe29f59
Compare
fe29f59
to
033c773
Compare
I've been thinking about this and wondering if there's an opportunity to simplify things and delete a bunch of code by using something like https://github.com/fabiocaccamo/python-benedict. If the existing project params were instantiated as a benedict instance, then you could do stuff like >>> from benedict import benedict
>>> params = benedict({'foo': { 'bar': [{'baz': 3}, 2]}})
>>> params['foo.bar[0].baz']=1
>>> params
{'foo': {'bar': [{'baz': 1}, 2]}} |
Thanks for the PR! π The suggestion regarding benedict is interesting and we could potentially consider using something like that in the future. If you'd like to file a separate feature request for it that would be great |
β I have followed the Contributing to DVC checklist.
π If this PR requires documentation updates, I have created a separate PR (or issue, at least) in dvc.org and linked it here.
Thank you for the contribution - we'll try to review it as soon as possible. π
Will close #4768
As stated in the issue, I'm sure more work will be needed, but this little tweak was enough to at least allow the experiment to run. Some more work would be required to get parameter diffs to show up nicely in
dvc exp show
(screenshot of current display is included below, see the change in activation function), but that might be out of scope for this issue.If there are no major objections, I can go ahead and write up some tests and finish this PR off proper-like.