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 path = (os.path.join(*([prop,name]+([cat] if cat else [])+([item] if item else []))) if split else path)+tag
if split: if split:
try: try:
tbl[inc].add(path,data) tbl[inc] = tbl[inc].add(path,data)
except KeyError: except KeyError:
tbl[inc] = Table(data.reshape(self.N_materialpoints,-1),{path:data.shape[1:]}) tbl[inc] = Table(data.reshape(self.N_materialpoints,-1),{path:data.shape[1:]})
else: else:
try: try:
tbl.add(path,data) tbl = tbl.add(path,data)
except AttributeError: except AttributeError:
tbl = Table(data.reshape(self.N_materialpoints,-1),{path:data.shape[1:]}) tbl = Table(data.reshape(self.N_materialpoints,-1),{path:data.shape[1:]})

View File

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