avoid adding to existing data, i.e. when reading a file

This commit is contained in:
Martin Diehl 2021-01-03 12:10:39 +01:00
parent 5f1399acc3
commit 80b8693a66
1 changed files with 2 additions and 3 deletions

View File

@ -11,11 +11,10 @@ class ConfigMaterial(Config):
'homogenization': {},
'phase': {}}
def __init__(self,d={}):
def __init__(self,d=_defaults):
"""Initialize object with default dictionary keys."""
super().__init__(d)
for k,v in self._defaults.items():
if k not in self: self[k] = v
def save(self,fname='material.yaml',**kwargs):
"""