[pythran] Problem with type ndarray

  • From: CHUPIN Maxime <chupin@xxxxxxxxxxxxxxxxxxxx>
  • To: pythran@xxxxxxxxxxxxx
  • Date: Wed, 11 Jan 2017 10:50:02 +0100

Hi everyone,

I try a very simple thing :

<<test.py>>
#pythran export sumop(float [])
def sumop(table):
      result = table[0]
      return result


I run pythran test.py and the .so file is created

Then, I want to use it :
<<main.py>>
import test as op
import numpy as np

table = np.arange(1000)
print type(table)
print op.sumop(table)

And I get the following error :

TypeError: Invalid argument type for pythranized function `sumop'.
Candidates are:
   sumop(ndarray<double,1>)

Do you know why ?
Thanks.
All the best

--
Maxime Chupin
Ingénieur de Recherche au CEREMADE Paris-Dauphine
site professionnel : https://www.ceremade.dauphine.fr/~chupin/
site personnel : http://fougeriens.org/~mc/
Bureau : 5e étage, bureau B513
Tél. : 0675250873


Other related posts: