|
From: Rolf K. <rol...@ci...> - 2008-06-05 05:36:29
|
Hi Glen So numpy and scipy functions can be used as long as native data types are used? That may cause some problems since I am trying to perform matrix operations. I am using LabVIEW 8.20 with python 2.5.2 and labpython 1.2.2 on Windows XP. I am trying to pass a 2D array of floats to python. It should be possible. The way I solved arrays in LabPython was to treat them as lists. Consequently 2D arrays are lists of lists. It is not very efficient but Python does even in 2.5 not give you an exported array C API with which I could retrieve any information from a numpy array, despite the fact that the Python core does know an array datatype. It would be possible to add something like that to LabPython by making use of the numpy extension and its exported C API but at the time I was developing LabPython numpy was just in its infancy taking over from its predecessor the numerical library. That API seemed not at all stable to me at that point and making LabPython depend only softly on it (meaning it would still work but without support of numpy datatypes) would also be some serious thinkering. I may take a look how numpy interfaces with Python to solve the array interface issue but to do it right would be a majour undertaking and I have a real job to do that pays the bills. Rolf Kalbermatter |