[Numpy-discussion] Anyone have a well-tested SWIG-based C++ STL valarray <=> numpy.array typemap to share?

David Goldsmith David.L.Goldsmith at noaa.gov
Wed Sep 5 12:16:24 EDT 2007


No I hadn't - thanks!  (Probably should have Google-d first, huh.  :-[ )

DG

Travis Vaught wrote:
> Have you seen this?
>
> http://www.scipy.org/Cookbook/SWIG_and_NumPy
>
> Also, the numpy/doc/swig directory has the simple typemaps.
>
> Travis
>
> On Sep 5, 2007, at 7:08 AM, Xavier Gnata wrote:
>
>   
>> I'm using the numpy C API (PyArray_SimpleNewFromData) to perform the
>> conversion but my code is written by hands. I would like to  
>> simplify it
>> using SWIG but I also would like to see a good typemap valarray <=>
>> numpy.array :)
>>
>> Joris : Historical ones? Maybe also the fact that distutils has  
>> some small pb with C++ module. To sum up : You have to compile you  
>> module with the same compiler options you used to compile Python.  
>> Python is coded in C so some options does not make sense in C++.
>> As a result, you get warnings at compile time (see pylab compiled  
>> with gcc for instance).
>>
>>
>> Xavier
>>
>>
>>
>>     
>>> A related question, just out of curiosity: is there a technical
>>> reason why Numpy has been coded in C rather than C++?
>>>
>>> Joris
>>>
>>>
>>>
>>> On 05 Sep 2007, at 02:24, David Goldsmith wrote:
>>>
>>>
>>>       
>>>> Anyone have a well-tested SWIG-based C++ STL valarray <=>  
>>>> numpy.array
>>>> typemap to share?  Thanks!
>>>>
>>>> DG
>>>> -- 
>>>> ERD/ORR/NOS/NOAA <http://response.restoration.noaa.gov/
>>>> emergencyresponse/>
>>>> _______________________________________________
>>>> Numpy-discussion mailing list
>>>> Numpy-discussion at scipy.org
>>>> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>>>>
>>>>         
>>> Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
>>>
>>> _______________________________________________
>>> Numpy-discussion mailing list
>>> Numpy-discussion at scipy.org
>>> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>>>
>>>
>>>       
>> -- 
>> ############################################
>> Xavier Gnata
>> CRAL - Observatoire de Lyon
>> 9, avenue Charles André
>> 69561 Saint Genis Laval cedex
>> Phone: +33 4 78 86 85 28
>> Fax: +33 4 78 86 83 86
>> E-mail: gnata at obs.univ-lyon1.fr
>> ############################################
>>
>> _______________________________________________
>> Numpy-discussion mailing list
>> Numpy-discussion at scipy.org
>> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>>
>>     
>
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion at scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>   

-- 
ERD/ORR/NOS/NOAA <http://response.restoration.noaa.gov/emergencyresponse/>



More information about the NumPy-Discussion mailing list