By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,050 Members | 1,009 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,050 IT Pros & Developers. It's quick & easy.

Numpy-f2py troubles

P: n/a
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.readsmspec(smspec, dimens)

Prompt a ValueError from Python:

File "D:\MyProjects\Carolina\MainPanel.py", line 894, in ReadSMSPECFile
dprops, dwgnames, dunits = readsmspec.readsmspec(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.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/
Oct 17 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Andrea,

you should post this to the numpy list:
nu**************@lists.sourceforge.net

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.readsmspec(smspec, dimens)

Prompt a ValueError from Python:

File "D:\MyProjects\Carolina\MainPanel.py", line 894, in ReadSMSPECFile
dprops, dwgnames, dunits = readsmspec.readsmspec(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.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/
Oct 18 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.