[f2py] Bad __doc__ for some functions/classes

Lorenzo Paulatto paulax at email.it
Wed May 16 12:40:47 EEST 2007


Dear f2py users and developers,
I am doing some tests with f2py before actually using it for a bigger
project. It works very fine but I have a minor problem with the
auto-generated documentation for imported classes and functions.

I have built a small test program in fortran, first I generate the
header, then I compile:
$ f2py p1dpo.f90 -m p1d -h p1d.pyf
Reading fortran codes...
        Reading file 'p1dpo.f90'
rmbadname1: Replacing "stdin" with "stdin_bn".
rmbadname1: Replacing "stdout" with "stdout_bn".
Post-processing...
        Block: p1d
                        Block: p1dmod
                        Block: init
                        Block: main
[...]
Saving signatures to file "./p1d.pyf"
$ f2py -c p1dpo.f90 -m p1d
[...]

Now I try to import and use the modules in python, but when getting the
__doc__ variable of anything but the upper module they are just bunches
of empty lines:

$ python
[...]
>>> import p1d
>>> print p1d.__doc__
This module 'p1d' is auto-generated with f2py (version:2.45.241_1926).
Functions:
  init()
  main(n_max)
Fortran 90/95 modules:
  p1dmod --- lam,stdout,tv,uv,l,stdin,t,file,v,is_alloc,ev,dbl.
>>> # This is OK, all the variables and functions are correctly imported
>>> print p1d.p1dmod.__doc__












>>> # isn't it a bit too verbose?
>>> print p1d.main.__doc__


>>> # This one is shorter, but effective!
>>>

I have tryed to put comment lines (just before and after the subroutine
and module declarations) in the pyf file and directly in the fortran
code, but they are apparently not used. Anyway even the default __doc__
would be ok if it where as in the user guide[1].

I can send the source coded if needed. Many thanks inadvance.

[1] e.g.
<http://cens.ioc.ee/projects/f2py2e/usersguide/index.html#multi-line-blocks>
-- 
Lorenzo `paulatz' Paulatto
Trieste

``Grandissima mi par l'inezia di coloro che vorrebbero che Iddio avesse
fatto l'universo più proporzionato alla piccola capacità del lor discorso.''
     --Galileo Galilei (Opere VII)
 
 
 --
 Email.it, the professional e-mail, gratis per te: http://www.email.it/f
 
 Sponsor:
 Non perderti nella giungla di facili promesse, Logos ti da credito sempre!
* 
 Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=6559&d=16-5



More information about the f2py-users mailing list