handle empty adjanceny array (#1647)
This commit is contained in:
parent
d74bbe3bf6
commit
a1eca4e2dd
@ -55,7 +55,9 @@ class GraphItem(GraphicsObject):
|
|||||||
"""
|
"""
|
||||||
if 'adj' in kwds:
|
if 'adj' in kwds:
|
||||||
self.adjacency = kwds.pop('adj')
|
self.adjacency = kwds.pop('adj')
|
||||||
if self.adjacency is not None and self.adjacency.dtype.kind not in 'iu':
|
if hasattr(self.adjacency, '__len__') and len(self.adjacency) == 0:
|
||||||
|
self.adjacency = None
|
||||||
|
elif self.adjacency is not None and self.adjacency.dtype.kind not in 'iu':
|
||||||
raise Exception("adjacency must be None or an array of either int or unsigned type.")
|
raise Exception("adjacency must be None or an array of either int or unsigned type.")
|
||||||
self._update()
|
self._update()
|
||||||
if 'pos' in kwds:
|
if 'pos' in kwds:
|
||||||
@ -140,8 +142,3 @@ class GraphItem(GraphicsObject):
|
|||||||
|
|
||||||
def pixelPadding(self):
|
def pixelPadding(self):
|
||||||
return self.scatter.pixelPadding()
|
return self.scatter.pixelPadding()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user