forge icon indicating copy to clipboard operation
forge copied to clipboard

add update function to add items to original flags using dict

Open YugeTen opened this issue 3 years ago • 2 comments

Usage:

import forge.experiment_tools as fet
config = forge.config()
update_dict = {"new_key": "new_val"}
fet.update(update_dict) # equivalent to config.new_key = "new_val"

YugeTen avatar Jun 23 '21 22:06 YugeTen

Hi, thanks for the PR! I wonder if maybe a better API for the update function would be update(**kwargs) so that we could call it as update(new_key=ney_val)? You could still use dicts by splaying them as update(**update_dict).

akosiorek avatar Jun 24 '21 10:06 akosiorek

Thanks for the suggestion! I have updated the method.

YugeTen avatar Jun 24 '21 11:06 YugeTen