diff --git a/.gitignore b/.gitignore index 20fa5360..75ada38e 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ parsetab.py dist/ build/ runtime/ +.gitconfig +.idea/ diff --git a/smop/Makefile b/smop/Makefile index 69938b79..f6e516cd 100644 --- a/smop/Makefile +++ b/smop/Makefile @@ -1,10 +1,10 @@ -# for py3: make PYTHON=python3 CYTHON="cython -3" V=3 +# for py2: make PYTHON=python CYTHON="cython" V=2.7 OCTAVE = /home/lei/octave-4.0.2 SCRIPTS = $(OCTAVE)/scripts/specfun -CYTHON = cython -PYTHON = python +CYTHON = cython -3 +PYTHON = python3 XFILES = -x inputParser.m,dblquad.m,triplequad.m COVERAGE = python3 -m coverage diff --git a/smop/callgraph.py b/smop/callgraph.py index 350bf154..35bd9f9e 100644 --- a/smop/callgraph.py +++ b/smop/callgraph.py @@ -26,6 +26,6 @@ def callgraph(G, stmt_list): #nx.write_dot(G,"G.dot") #for u in G.nodes(): # if G.out_degree(u) == 0: - # print u + # print(u) if __name__ == '__main__': main() diff --git a/smop/libsmop.py b/smop/libsmop.py index 06acd2bf..0a4654ff 100644 --- a/smop/libsmop.py +++ b/smop/libsmop.py @@ -396,7 +396,7 @@ def deal(a,**kwargs): return tuple([ai for ai in a.flat]) def disp(*args): - print (args) + print(args) def eig(a): u,v = np.linalg.eig(a) diff --git a/smop/parse.py b/smop/parse.py index 289a7487..6911490d 100644 --- a/smop/parse.py +++ b/smop/parse.py @@ -664,7 +664,7 @@ def p_persistent_stmt(p): # else: # assert p[2].__class__ in (node.let,node.ident), p[2].__class__ # p[0] = p[2] -# #print p[2] +# #print(p[2]) @exceptions @@ -739,7 +739,7 @@ def p_stmt(p): """ # END_STMT is intentionally left out p[0] = p[1] - # print p[0] + # print(p[0]) @exceptions @@ -830,7 +830,7 @@ def p_error(p): if p is None: raise_exception(SyntaxError, "Unexpected EOF", new_lexer) if p.type == "COMMENT": - # print "Discarded comment", p.value + # print("Discarded comment", p.value) parser.errok() return raise_exception(SyntaxError, @@ -869,5 +869,5 @@ def parse(buf): # # if "2" in options.debug: # for i,pi in enumerate(p): -# print i,pi.__class__.__name__,str(pi)[:50] +# print(i,pi.__class__.__name__,str(pi)[:50]) diff --git a/smop/resolve.py b/smop/resolve.py index 1e4b16f6..3171b558 100644 --- a/smop/resolve.py +++ b/smop/resolve.py @@ -51,19 +51,19 @@ def resolve(t, symtab=None, fp=None, func_name=None): G = as_networkx(t) for n in G.nodes(): print(n.__class__.__name__) - u = G.node[n]["ident"] + u = G.nodes[n]["ident"] if u.props: pass elif G.out_edges(n) and G.in_edges(n): u.props = "U" # upd - #print u.name, u.lineno, u.column + #print(u.name, u.lineno, u.column) elif G.in_edges(n): u.props = "D" # def elif G.out_edges(n): u.props = "R" # ref else: u.props = "F" # ??? - G.node[n]["label"] = "%s\\n%s" % (n, u.props) + G.nodes[n]["label"] = "%s\\n%s" % (n, u.props) return G def do_resolve(t,symtab): diff --git a/smop/rewrite.py b/smop/rewrite.py index f32f6422..c17ae9bb 100644 --- a/smop/rewrite.py +++ b/smop/rewrite.py @@ -84,7 +84,7 @@ def let_statement(u): # for nodename in component: # G.node[nodename]["ident"].props += "S" # sparse # #S = G.subgraph(nbunch) -# #print S.edges() +# #print(S.edges()) # return G diff --git a/smop/test_lexer.py b/smop/test_lexer.py index dc9e1cbd..06fa3a42 100644 --- a/smop/test_lexer.py +++ b/smop/test_lexer.py @@ -54,8 +54,8 @@ def test040(self): def test042(self): "backslash-newline continues a line" s = "foo \\\n bar ... hello\n bzz" - #print 43,`s` - #print '#', s.count('\n') + #print(43,`s`) + #print('#', s.count('\n')) self.lexer.input(s) # line continuation t = [tok.type for tok in self.lexer] diff --git a/smop/test_matlabarray.py b/smop/test_matlabarray.py index 6ff20ad8..c5340ffa 100644 --- a/smop/test_matlabarray.py +++ b/smop/test_matlabarray.py @@ -31,7 +31,7 @@ def test030(self): a[a.shape[0]+1,1:3] = 123 a[a.shape[0]+1,1:3] = 123 a[a.shape[0]+1,1:3] = 123 - #print a.shape + #print(a.shape) self.assertTrue(isequal (a, [[123,123,123], [123,123,123], [123,123,123]])) @@ -164,7 +164,7 @@ def test100(self): def test110(self): a = zeros (4,4,dtype=int) a[2:3,2:3] = 1 - #print a + #print(a) self.assertTrue(isequal (a,[[0,0,0,0], [0,1,1,0], [0,1,1,0], diff --git a/smop/test_primes.py b/smop/test_primes.py index 323091e0..fc347399 100644 --- a/smop/test_primes.py +++ b/smop/test_primes.py @@ -1,3 +1,3 @@ import liboctave -print liboctave.primes(10000) +print(liboctave.primes(10000))