rest documentation question

0 views
Skip to first unread message

Robert Miller

unread,
Jun 16, 2009, 4:28:09 PM6/16/09
to sage-devel
It seems that when I rest-ify a module using Sage, it alphabetizes the
functions under a class, and the classes and functions within the
module, even if I've ordered the functions more logically than
alphabetical. Is there a way to turn this off?

John Cremona

unread,
Jun 16, 2009, 4:39:46 PM6/16/09
to sage-...@googlegroups.com
2009/6/16 Robert Miller <rlmil...@gmail.com>:
Something I have asked on this list more than once, without ever
getting an answer!

John

> >
>

Robert Miller

unread,
Jun 16, 2009, 4:48:45 PM6/16/09
to sage-devel
> Something I have asked on this list more than once, without ever
> getting an answer!

Mike Hansen, ahem? ;-)

Ondrej Certik

unread,
Jun 16, 2009, 4:51:40 PM6/16/09
to sage-...@googlegroups.com

Yeah, just yesterday I asked myself the same question in sphinx --- I
assume it's a sphinx problem.

Ondrej

Mike Hansen

unread,
Jun 16, 2009, 5:59:44 PM6/16/09
to sage-...@googlegroups.com

Sphinx does this by introspection so it needs to come up with some
order on the methods. If you want something done based on the order
they are in the file, then you need to do something like inspecting
the func_code object. Since Cython objects don't have these, you need
to do something else with the line info. Also, you need to figure out
what to do if you include methods from superclasses (which we don't,
but is possible with the autodoc extension). It's probably doable, but
no one has done it.

Also, there are probably lots of modules and classes where an
alphabetical listing is way better than the one they are in in the
code since the alphabetical is at least consistent and predictable.

--Mike

Nick Alexander

unread,
Jun 16, 2009, 6:09:45 PM6/16/09
to sage-...@googlegroups.com
> Also, there are probably lots of modules and classes where an
> alphabetical listing is way better than the one they are in in the
> code since the alphabetical is at least consistent and predictable.

I think that alphabetical is probably the simplest option. This
suggests that module level documentation needs to give the overview/
organization that Robert wants. Carl Witty is the master of such
organization.

Nick

Ondrej Certik

unread,
Jun 16, 2009, 6:25:29 PM6/16/09
to sage-...@googlegroups.com

Note that in sphinx you can set the order by hand yourself by the
:members: field like this:

.. autoclass:: Theora
:members: get_frame_image, read_frame

I just checked that.

Ondrej

Robert Bradshaw

unread,
Jun 17, 2009, 2:27:12 AM6/17/09
to sage-...@googlegroups.com

Often related functions are grouped together in the file, and I would
like this to be preserved (if possible). Alphabetical is fine for an
index, but otherwise information is lost. For example, for
ell_rational_field, all the hegner point methods are grouped, all the
p-adic l-function methods are grouped, all the methods dealing with
sha are grouped, etc.

- Robert


William Stein

unread,
Jun 17, 2009, 3:15:19 AM6/17/09
to sage-...@googlegroups.com

It seems to me that the only thing we can do is parse the file a
little and generate the
lines Ondrej lists above.

-- William

Reply all
Reply to author
Forward
0 new messages