Feature request
The set_config Hyrax method is explicitly meant to merge the new setting into the existing settings. Most of the time this is exactly what you want to do.
However, there are times, such as when setting the data_request, that it's not useful to merge the config, instead it would be more useful to simply overwrite it.
Here's the current behavior:
data_request = {'train': 'data_0': {...}}
h.set_config('data_request', data_request)
print(h.config['data_request'])
>> data_request{ train{
data_request = {'train': 'data_1': {...}}
h.set_config('data_request', data_request)
print(h.config['data_request'])
>> data_request{ train{ data_0 { ... }, data_1 { ... } } }
The expectation would be that train would contain only data_1 at the end of the process, but we see that data_1 and been merged into train data_group.
Thus I propose that we could implement a over_write flag in set_config.
def set_config(dotted_string: str, new_value: any, over_write=False)
When over_write==True the value at dotted_string in the config is completely replaced by the new_value. If over_write==False then we use the current logic.
Feature request
The
set_configHyrax method is explicitly meant to merge the new setting into the existing settings. Most of the time this is exactly what you want to do.However, there are times, such as when setting the data_request, that it's not useful to merge the config, instead it would be more useful to simply overwrite it.
Here's the current behavior:
The expectation would be that train would contain only
data_1at the end of the process, but we see that data_1 and been merged intotraindata_group.Thus I propose that we could implement a
over_writeflag in set_config.When
over_write==Truethe value atdotted_stringin the config is completely replaced by thenew_value. Ifover_write==Falsethen we use the current logic.