[SciPy-dev] returning string by f2py

dmitrey dmitrey.kroshko at scipy.org
Thu Mar 13 07:56:56 EDT 2008


Hi Pearu,

have you encountered any success with the problem (returning string from 
fortran)?

If no, I could try to modify and connect to openopt and scipy bvls.f90 
version.

(However, I think connecting f77 code is more preferred than f90, 
because some computers can have f77 but have no f90 compiler installed, 
am I right)?

Regards, D.

BTW, I had noticed some parameters return incorrect value as well, for 
example loopa (number of iterations elapsed) always has same value that 
I pass to the fortran routine (even w/o any my modifications to code, 
simple f2py -c -m ...).


dmitrey wrote:
> Pearu Peterson wrote:
>> On Tue, March 11, 2008 10:50 am, dmitrey wrote:
>>  
>>> hi all,
>>> I have modified bvls.f file to make it good enough to be connected to
>>> scipy (add istop and msg - integer & string description of stop case).
>>>
>>> However, I always get same msg value that I pass to the routine (via
>>> f2py).
>>>
>>> Could anyone check the modified bvls.f file?
>>> http://scipy.org/scipy/scikits/attachment/wiki/OOFiles/bvls.f
>>>
>>> (Or mb something should be modified in Python code?)
>>>     
>>
>> Can you give an example how to create the wrapper
>> and how to you use it from Python? Until that I can only
>> suggest using intent(out) for msg argument.
>>
>> Pearu
>>
>>   
> here's (same) test file attached; as for f2py I just use
> f2py -c -m bvls bvls.f
> I think it's better to have default f2py using (w/o any additional 
> wrap files like .pyf), and make all required changes in py-file that 
> will call compiled f-file. I intend to make it available immediately 
> from scikits.openopt LLSP webpage (for download and using from OO) and 
> then connect it to scipy.optimize (also w/o auxiliary wrapper files).
> Currently it returns same values as have been passed: istop=0 and same 
> msg.
> Regards, D.
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Scipy-dev mailing list
> Scipy-dev at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-dev




More information about the SciPy-Dev mailing list