[Numpy-discussion] numpy documentation

Nicolas Gruel nicolas.gruel@gmail....
Thu Jun 3 04:03:24 CDT 2010


Hello,

I would like to document one of my project using sphinx and as it's a
scientific project I would like to use the same thing than numpy for
consistancy.

I am using the sphinx extension provided by numpy. It's working fine but for
one thing I do have a problem. The summary of the methods creating using
autodoc does not contains the description of the methods, the table contains
only the name with a blanck description.

I join the rst file and the python file I am using for the test perhaps it's
something I missed inside.

Another question, it's seems that the rst file for each function in numpy
are autogenerated. Can you give me any information how to do it, please? I
didn't find it on numpy website but I probably miss the good link...

Thank you for any help.

Nicolas

here the two files:

foo.rst

------------------------------------------
Foo
===

:mod:`foo`
----------

.. automodule:: foo
   :members:


.. autosummary::
     :toctree: Modules/

        func
------------------------------------------------------

foo.py

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

#!/usr/bin/env python
# -*- coding: utf-8 -*-


__docformat__ = 'restructuredtext en'
__version__ = '1.0'


class Bar(object):
    r"""
    A description of the class

    Attributes
    ----------
    a : float
     an attribute.
    b : float
     another attribute

    Methods
    -------
    func : description
        toto
    """

    def __init__(self, a, b):
        self.a = a
        self.b = b

    def func(self, a, b):
        r"""
        A simple function describe here.

        Parameters
        ----------
        a : float
            a number
        b : float
            another number

        Return
        ------
        func : float
            a number

        Examples
        --------

        >>> a = 2; b = 3
        >>> foo.Bar(a,b).func(a+1,b+1)
        2 3
        4 5

        See Also
        --------
        f1 : Function with its description.
        """
        print self.a, self.b
        print a, b
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20100603/a133b74a/attachment.html 


More information about the NumPy-Discussion mailing list