|
@@ -291,16 +291,6 @@ class NilmDB(object): |
|
|
if group == '': |
|
|
if group == '': |
|
|
raise ValueError("invalid path") |
|
|
raise ValueError("invalid path") |
|
|
|
|
|
|
|
|
# Make the group structure, one element at a time |
|
|
|
|
|
group_path = group.lstrip('/').split("/") |
|
|
|
|
|
for i in range(len(group_path)): |
|
|
|
|
|
parent = "/" + "/".join(group_path[0:i]) |
|
|
|
|
|
child = group_path[i] |
|
|
|
|
|
try: |
|
|
|
|
|
self.h5file.createGroup(parent, child) |
|
|
|
|
|
except tables.NodeError: |
|
|
|
|
|
pass |
|
|
|
|
|
|
|
|
|
|
|
# Get description |
|
|
# Get description |
|
|
try: |
|
|
try: |
|
|
desc = nilmdb.layout.get_named(layout_name).description() |
|
|
desc = nilmdb.layout.get_named(layout_name).description() |
|
@@ -314,7 +304,8 @@ class NilmDB(object): |
|
|
# Create the table |
|
|
# Create the table |
|
|
table = self.h5file.createTable(group, node, |
|
|
table = self.h5file.createTable(group, node, |
|
|
description = desc, |
|
|
description = desc, |
|
|
expectedrows = exp_rows) |
|
|
|
|
|
|
|
|
expectedrows = exp_rows, |
|
|
|
|
|
createparents = True) |
|
|
|
|
|
|
|
|
# Insert into SQL database once the PyTables is happy |
|
|
# Insert into SQL database once the PyTables is happy |
|
|
with self.con as con: |
|
|
with self.con as con: |
|
|