diff --git a/grandalf/graphs.py b/grandalf/graphs.py index b008b78..24e2b01 100644 --- a/grandalf/graphs.py +++ b/grandalf/graphs.py @@ -15,7 +15,6 @@ # published under GPLv2 license or EPLv1 license from .utils import Poset -from operator import attrgetter #------------------------------------------------------------------------------ @@ -133,6 +132,9 @@ def index(self): def __lt__(self,v): return 0 + def __gt__(self,v): + return 0 + def __getstate__(self): return (self.index,self.data) @@ -165,7 +167,7 @@ def __init__(self,x,y,w=1,data=None,connect=False): self.w = w self.data = data self.feedback = False - if connect and (x.c==None or y.c==None): + if connect and (x.c is None or y.c is None): c = x.c or y.c c.add_edge(self) @@ -187,6 +189,9 @@ def detach(self): def __lt__(self,v): return 0 + def __gt__(self,v): + return 0 + def __getstate__(self): xi,yi = (self.v[0].index,self.v[1].index) return (xi,yi,self.w,self.data,self.feedback) diff --git a/grandalf/layouts.py b/grandalf/layouts.py index 4f70d82..e2461c8 100644 --- a/grandalf/layouts.py +++ b/grandalf/layouts.py @@ -20,7 +20,6 @@ import importlib from bisect import bisect from sys import getrecursionlimit,setrecursionlimit -from operator import attrgetter from grandalf.utils import * @@ -154,6 +153,9 @@ class Layer(list): __x = 1. ccount = None + def __eq__(self,other): + return super().__eq__(other) + def __str__(self): s = 'um link is used for alignment if (vpair not in self.conflicts) and \ - (r==None or dirh*r