I have a python module which is python extension code.  I have two
functions in the module, which show up in di and which have rest
__doc__ strings.  When I call automodule, the module docstring is
included but the functions are not (using sphinx 0.5)

Here is my rst file::

    *******************
    matplotlib nxutils
    *******************

    :mod:`matplotlib.nxutils`
    ===========================

    .. automodule:: matplotlib.nxutils

which is shown rendered here:
http://matplotlib.sourceforge.net/api/nxutils_api.html

Here is an example python session showing the functions and doc
strings are present::

    In [1]: import matplotlib.nxutils as nx

    In [2]: print nx.__doc__
    general purpose numerical utilities, eg for computational
geometry, that are not available in `numpy <http://numpy.scipy.org>`_

    In [3]: dir(nx)
    Out[3]: ['__doc__', '__file__', '__name__', 'pnpoly', 'points_inside_poly']

    In [4]: print nx.pnpoly.__doc__
    inside = pnpoly(x, y, xyverts)

    Return 1 if x,y is inside the polygon, 0 otherwise.

    *xyverts*
        a sequence of x,y vertices.

    A point on the boundary may be treated as inside or outside.
    See `pnpoly
<http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html>`_

    In [5]: print nx.points_inside_poly.__doc__
    mask = points_inside_poly(xypoints, xyverts)

    Return a boolean ndarray, True for points inside the polygon.

    *xypoints*
        a sequence of N x,y pairs.
    *xyverts*
        sequence of x,y vertices of the polygon.
    *mask*    an ndarray of length N.

    A point on the boundary may be treated as inside or outside.
    See `pnpoly
<http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html>`_

and here is the relevant bit of the c extension code where the
docstrings are set and the module initialized::

    static PyMethodDef module_methods[] = {
      {"pnpoly",  pnpoly, METH_VARARGS,
            "inside = pnpoly(x, y, xyverts)\n\n"
            "Return 1 if x,y is inside the polygon, 0 otherwise.\n\n"
            "*xyverts*\n    a sequence of x,y vertices.\n\n"
            "A point on the boundary may be treated as inside or outside.\n"
            "See `pnpoly
<http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html>`_"},
      {"points_inside_poly",  points_inside_poly, METH_VARARGS,
            "mask = points_inside_poly(xypoints, xyverts)\n\n"
            "Return a boolean ndarray, True for points inside the polygon.\n\n"
            "*xypoints*\n    a sequence of N x,y pairs.\n"
            "*xyverts*\n    sequence of x,y vertices of the polygon.\n"
            "*mask*    an ndarray of length N.\n\n"
            "A point on the boundary may be treated as inside or outside.\n"
            "See `pnpoly
<http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html>`_\n"},
      {NULL}  /* Sentinel */
    };

    PyMODINIT_FUNC
         initnxutils(void)
    {
      PyObject* m;

      m = Py_InitModule3("nxutils", module_methods,
                         "general purpose numerical utilities, eg for
computational geometry, that are not available in `numpy
<http://numpy.scipy.org>`_");

      if (m == NULL)
        return;

      import_array();
    }

Any ideas?
JDH

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sphinx-dev" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sphinx-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to