hydromt.model.components.ConfigComponent.update#

ConfigComponent.update(data: Dict[str, Any])[source]#

Set the config dictionary at key(s) with values.

Parameters:

data (Dict[str,Any]) – A dictionary with the values to be set. keys can be dotted like in set_value()

Examples

Setting data as a nested dictionary:

>> self.update({'a': 1, 'b': {'c': {'d': 2}}})
>> self.data
{'a': 1, 'b': {'c': {'d': 2}}}

Setting data using dotted notation:

>> self.update({'a.d.f.g': 1, 'b': {'c': {'d': 2}}})
>> self.data
{'a': {'d':{'f':{'g': 1}}}, 'b': {'c': {'d': 2}}}