← Back to team overview

dolfin team mailing list archive

Re: autogenerated docstrings

 

ok! Works now. Excellent.

/Anders


Johan Hake wrote:
Hello!

Sorry for this misstake. You can just erase the lines that tries to import from doxy2swig, as the class Doxy2SWIG is allready in the script. Note that there are two lines.

Then it should go smooth, I hope ;)

Johan


On Tuesday 25 September 2007 00:16:48 Anders Logg wrote:
Something is missing (or wrong):

Traceback (most recent call last):
   File "generate.py", line 64, in <module>
     g.generate_interface_file_from_index()
   File
"/scratch/dolfin/dolfin-dev/src/pydolfin/generate_docstrings.py", line
430, in generate_interface_file_from_index
     from  doxy2swig import Doxy2SWIG
ImportError: No module named doxy2swig

Did something go wrong in the cleanup?

/Anders

Johan Hake wrote:
Hello!

I have added a script that generate swig interface files with docstrings.
The docstrings is extracted from doxygen produced xml documentation, so
doxygen needs to be installed. The script generate.py needs to be run
before compilation, as previously.

The script is based on another script made by Prabhu Ramachandran, the
developer of MayaVi.

The result is quite nice.

from dolfin import UnitSquare

print UnitSquare.__doc__
    Triangular mesh of the 2D unit square (0,1) x (0,1). Given the number
    of cells (nx, ny) in each direction, the total number of triangles
    will be 2*nx*ny and the total number of vertices will be (nx + 1)*(ny
    + 1).

    C++ includes: UnitSquare.h

print UnitSquare.numCells.__doc__
        numCells(self) -> uint

        Return number of cells.

I have included a change set in a bundle, if the feature is of interest.
I hope it gets through, its 21 KB.


Johan


------------------------------------------------------------------------

_______________________________________________
DOLFIN-dev mailing list
DOLFIN-dev@xxxxxxxxxx
http://www.fenics.org/mailman/listinfo/dolfin-dev




References