adapted to Table.add being out-of-place

This commit is contained in:
Philip Eisenlohr 2021-03-08 11:03:18 -05:00
parent 7cbc69a4ca
commit 4208c4e713
2 changed files with 3 additions and 2 deletions

View File

@ -391,12 +391,12 @@ class Result:
path = (os.path.join(*([prop,name]+([cat] if cat else [])+([item] if item else []))) if split else path)+tag
if split:
try:
tbl[inc].add(path,data)
tbl[inc] = tbl[inc].add(path,data)
except KeyError:
tbl[inc] = Table(data.reshape(self.N_materialpoints,-1),{path:data.shape[1:]})
else:
try:
tbl.add(path,data)
tbl = tbl.add(path,data)
except AttributeError:
tbl = Table(data.reshape(self.N_materialpoints,-1),{path:data.shape[1:]})

View File

@ -379,6 +379,7 @@ class Table:
-------
table : Table
Joined table.
"""
if set(self.shapes) & set(other.shapes) or self.data.shape[0] != other.data.shape[0]:
raise KeyError('Dublicated keys or row count mismatch')