[f2py] Wrapping function with unknown return array size.

Berthold Höllmann berthold at despammed.com
Thu May 3 16:21:44 EEST 2007


I have a function where the size of one of the return values can not
be determined before calling the function. Currently I have a hand
written wrapper that guesses one value, generates a result array for
this value, calls the function and checks a return value. A certain
value in this return value indicates insufficient memory, so the space
for the return values is enlarged and the function is tried until the
provided memory is sufficient. The return array is truncated to the
number of required values, converted to a numpy array and returned.

Is it possible to define a similar mechanism for f2py? I would prefer
to not do the loop in Python.

Kind regards
Berthold
-- 
                            __   Address:
                         G /  \ L Germanischer Lloyd
phone: +49-40-36149-7374 -+----+- Vorsetzen 35       P.O.Box 111606
fax  : +49-40-36149-7320   \__/   D-20459 Hamburg    D-20416 Hamburg




More information about the f2py-users mailing list