[Numpy-discussion] SphinxDocString class in new numpy doc framework
Stéfan van der Walt
stefan at sun.ac.za
Mon Jun 30 02:14:41 EDT 2008
Hi Matt
The docstring for ``np.swapaxes`` is broken -- notice the indent after
the first line. If you remove that, things should be fine:
In [31]: d = np.swapaxes.__doc__
In [32]: d = d.split('\n')
In [33]: d[0] = ' Return a view of an array a with axis1 and axis2
interchanged.'
In [34]: print SphinxDocString('\n'.join(d))
Return a view of an array a with axis1 and axis2 interchanged.
**Parameters**
``````````````
**a** : array_like
Input array.
etc.
Cheers
Stéfan
2008/6/30 Matt Knox <mattknox_ca at hotmail.com>:
>
> I guess this question is mostly for Stefan... but I am trying to port the
> scikits.timeseries module wiki documentation into a sphinx framework, and
> also
> trying to follow the numpy doc string standards (which can't be parsed
> directly
> by sphinx), so I'm trying to use the SphinxDocString class in
> docscrape_sphinx.py to pre-process the doc strings. However, the doc strings
> do
> not seem to be getting processed correctly. I didn't dig deep into the
> issue,
> but I thought I'd ask first before I go any further in case I am approaching
> this incorrectly all together.
>
> If I try to process the numpy.swapaxes docstring for example, I get the
> following output (note the formatting of the parameters):
>
>>>> print SphinxDocString(np.swapaxes.__doc__)
More information about the NumPy-Discussion
mailing list