def __init__(self, filename=None):
self._filename = filename
+
+ def _create_basedir(self, filename):
+ dirname = _os_path.dirname(filename)
+ if not _os_path.isdir(dirname):
+ _os.makedirs(dirname)
self._file_checked = True
def _setup_file(self):
+ self._create_basedir(filename=self._filename)
with _h5py.File(self._filename, 'a') as f:
cwg = f # current working group
h5_create_group(cwg, self.group)
return config
def _save(self, config):
+ self._create_basedir(filename=self._filename)
data = self._to_dict(config)
with open(self._filename, 'w') as f:
_yaml.dump(data, stream=f, Dumper=self.dumper,