Solve not a group bug
This commit is contained in:
+9
-2
@@ -9,8 +9,9 @@ from functools import partial
|
||||
import numpy as np
|
||||
|
||||
import tables
|
||||
|
||||
from tables import HDF5ExtError
|
||||
from tables.registry import class_name_dict
|
||||
|
||||
from params import default_params, load_params
|
||||
from units import U
|
||||
import traceback
|
||||
@@ -408,8 +409,14 @@ class HDF5Container(BaseProcessor):
|
||||
except TypeError:
|
||||
data = np.array([data])
|
||||
|
||||
group_name = os.path.dirname(name_full)
|
||||
if group_name in self.save:
|
||||
group = self.save[group_name]
|
||||
if not isinstance(group, class_name_dict['Group']):
|
||||
self._log(f"{group_name} already there and no a group, deleting", "WARNING")
|
||||
self.save.remove_node(group)
|
||||
self.save.create_array(
|
||||
os.path.dirname(name_full),
|
||||
group_name,
|
||||
os.path.basename(name_full),
|
||||
data,
|
||||
description,
|
||||
|
||||
Reference in New Issue
Block a user