Sphinx question: automethod and autofunction in integrals.rst

43 views
Skip to first unread message

Joachim Durchholz

unread,
Mar 3, 2015, 1:24:06 PM3/3/15
to sy...@googlegroups.com
Hi all,

I need some feedback about whether what I see is intentional (and I'm
missing something), or just a bug.

The file in question is doc/src/modules/integrals/integrals.rst .

First an example of a section that seems correct to me:
========================================
Integral Transforms
-------------------

.. module:: sympy.integrals.transforms

SymPy has special support for definite integrals, and integral transforms.

.. autofunction:: mellin_transform
.. autofunction:: inverse_mellin_transform
========================================
It generates
http://docs.sympy.org/latest/modules/integrals/integrals.html#module-sympy.integrals.transforms
and lists e.g. mellin_transform as
"sympy.integrals.transforms.mellin_transform" .

Now the section that I do not understand:
========================================
API reference
-------------

.. automethod:: sympy.integrals.integrate

.. automethod:: sympy.integrals.line_integrate
========================================
Output is on
http://docs.sympy.org/latest/modules/integrals/integrals.html#api-reference
and lists e.g. integrate as "static integrals.integrate".
What I find dubious here is that integrate() is not a method, it is a
global function in module sympy.integrals.integrals(!).

I suspect that Sphinx thinks that "integrals" is a class and "integrate"
a method in it, but happens to get it right that "integrate" is indeed
static.
Is that correct? If yes, I'd replace those "automethod" entries with
appropriate "autofunction" ones.

Aaron Meurer

unread,
Mar 3, 2015, 2:49:04 PM3/3/15
to sy...@googlegroups.com
That's wrong. It works because technically functions are methods of
their module, but it really should use autofunction or autoclass. I
remember fixing a lot of this a long time ago but I guess some of them
are still there. It's disappointing that Sphinx doesn't issue any
warnings in this case.

Aaron Meurer
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sympy+un...@googlegroups.com.
> To post to this group, send email to sy...@googlegroups.com.
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/54F5FC43.6080205%40durchholz.org.
> For more options, visit https://groups.google.com/d/optout.

Joachim Durchholz

unread,
Mar 3, 2015, 4:20:04 PM3/3/15
to sy...@googlegroups.com
Am 03.03.2015 um 20:48 schrieb Aaron Meurer:
> That's wrong.

Good to know. I'm going to include the fix for this specifically as a
"windfall fix" in my next remove-C update (I need it done to get a
Sphinx build failure out of Travis).

> It works because technically functions are methods of
> their module, but it really should use autofunction or autoclass.

Thanks, that confirms my assumptions about what's going on.

> I
> remember fixing a lot of this a long time ago but I guess some of them
> are still there. It's disappointing that Sphinx doesn't issue any
> warnings in this case.

I sympathize.
Reply all
Reply to author
Forward
0 new messages