Skip to content

Commit

Permalink
Correct duplicate function with missing contents
Browse files Browse the repository at this point in the history
  • Loading branch information
EmilyBourne committed Jul 28, 2023
1 parent 4e703de commit d2ec6a8
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions pyccel/codegen/printing/pycode.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,11 @@ def _print_NumpyArray(self, expr):
dtype += str(expr.precision*factor)

name = self._aliases.get(type(expr), expr.name)
if name == 'array':
self.insert_new_import(
source = 'numpy',
target = AsName(NumpyArray, 'array'))

arg = self._print(expr.arg)
dtype = "dtype={}".format(dtype)
order = "order='{}'".format(expr.order) if expr.order else ''
Expand Down Expand Up @@ -694,15 +699,6 @@ def _print_PyccelInternalFunction(self, expr):
args = ', '.join(self._print(a) for a in expr.args)
return "{}({})".format(name, args)

def _print_NumpyArray(self, expr):
name = self._aliases.get(type(expr),'array')
if name == 'array':
self.insert_new_import(
source = 'numpy',
target = AsName(NumpyArray, 'array'))
arg = self._print(expr.arg)
return "{}({})".format(name, arg)

def _print_NumpyRandint(self, expr):
name = self._aliases.get(type(expr), expr.name)
if expr.low:
Expand Down

0 comments on commit d2ec6a8

Please sign in to comment.