Numpy-f2py troubles

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andrea Gavana

    #1

    Numpy-f2py troubles

    Hello NG,

    I am using the latest Numpy release 1.0rc2 which includes F2PY. I
    have switched to Python 2.5 so this is the only alternative I have
    (IIUC). With Python 2.4, I was able to build a very simple fortran
    extension without problems.

    My extension contains 4 subroutines that scan a file and do simple operations.
    Now, attempting to run the second subroutine as:

    dprops, dwgnames, dunits = readsmspec.read smspec(smspec, dimens)

    Prompt a ValueError from Python:

    File "D:\MyProjects\ Carolina\MainPa nel.py", line 894, in ReadSMSPECFile
    dprops, dwgnames, dunits = readsmspec.read smspec(smspec, dimens)
    ValueError: data type must provide an itemsize

    ?!? I have never seen anything like that and googling around didn't
    give me any answer. The function accepts two inputs:

    - smspec: a filename, maximum 1000 characters long
    - dimens: an integer

    and returns 3 array of chars, each of them with size (8, dimens). Does
    anyone know what I may be doing wrong?

    Thank you very much for every pointer.


    --
    Andrea.

    "Imaginatio n Is The Only Weapon In The War Against Reality."

  • bernhard.voigt@gmail.com

    #2
    Re: Numpy-f2py troubles

    Hi Andrea,

    you should post this to the numpy list:
    numpy-discussion@list s.sourceforge.n et

    Cheers! Bernhard

    Andrea Gavana schrieb:
    Hello NG,
    >
    I am using the latest Numpy release 1.0rc2 which includes F2PY. I
    have switched to Python 2.5 so this is the only alternative I have
    (IIUC). With Python 2.4, I was able to build a very simple fortran
    extension without problems.
    >
    My extension contains 4 subroutines that scan a file and do simple operations.
    Now, attempting to run the second subroutine as:
    >
    dprops, dwgnames, dunits = readsmspec.read smspec(smspec, dimens)
    >
    Prompt a ValueError from Python:
    >
    File "D:\MyProjects\ Carolina\MainPa nel.py", line 894, in ReadSMSPECFile
    dprops, dwgnames, dunits = readsmspec.read smspec(smspec, dimens)
    ValueError: data type must provide an itemsize
    >
    ?!? I have never seen anything like that and googling around didn't
    give me any answer. The function accepts two inputs:
    >
    - smspec: a filename, maximum 1000 characters long
    - dimens: an integer
    >
    and returns 3 array of chars, each of them with size (8, dimens). Does
    anyone know what I may be doing wrong?
    >
    Thank you very much for every pointer.
    >
    >
    --
    Andrea.
    >
    "Imaginatio n Is The Only Weapon In The War Against Reality."
    http://xoomer.virgilio.it/infinity77/

    Comment

    Working...