← Back to team overview

dolfin team mailing list archive

Re: autogenerated docstrings

 

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


Follow ups

References