Skip to content

Commit

Permalink
merge fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
victorlei committed Sep 16, 2014
1 parent d59d2a4 commit df6abd8
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions smop/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,25 +123,22 @@ def _backend(self,level=0):
return node.number(self.args[0].value +
self.args[1].value)._backend()
else:
return "(%s +%s)" % (self.args[0]._backend(),
return "(%s+%s)" % (self.args[0]._backend(),
self.args[1]._backend())

@extend(node.sub)
def _backend(self,level=0):
return "(%s -%s)" % (self.args[0]._backend(),
return "(%s-%s)" % (self.args[0]._backend(),
self.args[1]._backend())

@extend(node.expr)
def _backend(self,level=0):
if self.op == '*':
return "np.dot(%s, %s)" % (self.args[0]._backend(),
self.args[1]._backend())
if self.op == '@': # FIXME
return self.args[0]._backend()

if self.op == "\\":
return "np.linalg.solve(%s, %s)" % (self.args[0]._backend(),
self.args[1]._backend())
return "numpy.linalg.solve(%s,%s)" % (self.args[0]._backend(),
self.args[1]._backend())
if self.op == "::":
if not self.args:
return ":"
Expand Down Expand Up @@ -232,7 +229,7 @@ def _backend(self,level=0):

@extend(node.expr_list)
def _backend(self,level=0):
return ", ".join([t._backend() for t in self])
return ",".join([t._backend() for t in self])

@extend(node.concat_list)
def _backend(self,level=0):
Expand Down

0 comments on commit df6abd8

Please sign in to comment.