You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I use python -3 to run the source code, it will show:
mv.py:1485: DeprecationWarning: the cmp argument is not supported in 3.x
self.terms.sort(key=operator.itemgetter(1), cmp=Pdop.compare)
that means you can not use cmp in sort in python3.
I look at all the program, just line 1485 in mv.py use Pdop.compare, so just change line 1485 in mv.py into
self.terms.sort(key=Pdop.compare)
change the whole definition of Pdop.compare in line 1765 in mv.py into:
def compare(pdop): # compare two Pdops
keys = list(pdop[1].pdiffs.keys())
return (pdop[1].order,-len(keys),''.join([str(pdop[1].Ga.coords.index(x)) for x in keys]))
Now use order to sort first aka to
if pdop1.order > pdop2.order:
return 1
if pdop1.order < pdop2.order:
return -1
-len(keys) to sort second aka to
if lkeys1 < lkeys2:
return 1
else:
return -1
''.join([str(pdop[1].Ga.coords.index(x)) for x in keys]) to sort third aka to
if lkeys1 == lkeys2:
s1 = ''.join([str(pdop1.Ga.coords.index(x)) for x in keys1])
s2 = ''.join([str(pdop1.Ga.coords.index(x)) for x in keys2])
if s1 < s2:
return -1
else:
return 1
reference https://docs.python.org/3/howto/sorting.html
@chaowenguo commented on Jan 19, 2017
From http://cc.bingj.com/cache.aspx?q=https%3a%2f%2fgithub.com%2fbrombo%2fgalgebra%2fissues%2f34&d=5055631851848655&mkt=en-GB&setlang=en-US&w=lez4CYMwRC77CTRGlKMukgviK_qX7JO6
The text was updated successfully, but these errors were encountered: