corrections for 1d arrays
This commit is contained in:
parent
4543031ac5
commit
9893fc3735
@ -91,12 +91,13 @@ class DiffTreeWidget(QtGui.QWidget):
|
|||||||
#for i in np.argwhere(~eq):
|
#for i in np.argwhere(~eq):
|
||||||
|
|
||||||
else:
|
else:
|
||||||
for i,k in enumerate(info.dtype.fields.keys()):
|
if a.dtype == b.dtype:
|
||||||
eq = self.compareArrays(a[k], b[k])
|
for i,k in enumerate(a.dtype.fields.keys()):
|
||||||
if not np.all(eq):
|
eq = self.compareArrays(a[k], b[k])
|
||||||
for n in tableNodes:
|
if not np.all(eq):
|
||||||
n.setBackground(0, fn.mkBrush(bad))
|
for n in tableNodes:
|
||||||
#for j in np.argwhere(~eq):
|
n.setBackground(0, fn.mkBrush(bad))
|
||||||
|
#for j in np.argwhere(~eq):
|
||||||
|
|
||||||
# dict: compare keys, then values where keys match
|
# dict: compare keys, then values where keys match
|
||||||
# list:
|
# list:
|
||||||
|
@ -222,6 +222,8 @@ class TableWidget(QtGui.QTableWidget):
|
|||||||
return self.iterate, list(map(asUnicode, data.dtype.names))
|
return self.iterate, list(map(asUnicode, data.dtype.names))
|
||||||
elif data is None:
|
elif data is None:
|
||||||
return (None,None)
|
return (None,None)
|
||||||
|
elif np.isscalar(data):
|
||||||
|
return self.iterateScalar, None
|
||||||
else:
|
else:
|
||||||
msg = "Don't know how to iterate over data type: {!s}".format(type(data))
|
msg = "Don't know how to iterate over data type: {!s}".format(type(data))
|
||||||
raise TypeError(msg)
|
raise TypeError(msg)
|
||||||
@ -236,6 +238,9 @@ class TableWidget(QtGui.QTableWidget):
|
|||||||
for x in data:
|
for x in data:
|
||||||
yield x
|
yield x
|
||||||
|
|
||||||
|
def iterateScalar(self, data):
|
||||||
|
yield data
|
||||||
|
|
||||||
def appendRow(self, data):
|
def appendRow(self, data):
|
||||||
self.appendData([data])
|
self.appendData([data])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user