remove options not specified via CLI before merging args
This commit is contained in:
parent
73a2cadc36
commit
5e11ce0dcd
|
@ -25,6 +25,10 @@ class Config(attrdict.AttrDict):
|
|||
|
||||
def merge_args(self, args):
|
||||
args_dict = vars(args)
|
||||
# remove options that is not passed via CLI
|
||||
for k, v in args_dict:
|
||||
if v is None:
|
||||
args_dict.pop(k)
|
||||
args_dict.pop("config") # exclude config file path
|
||||
nested_dict = flatdict.FlatDict(args_dict, delimiter=".").as_dict()
|
||||
self.update(nested_dict)
|
||||
|
|
Loading…
Reference in New Issue