Sphinx forgets variables between doctests

2 views
Skip to first unread message

Nathann Cohen

unread,
Sep 1, 2010, 12:16:58 PM9/1/10
to Sage devel
Hello everybody !!!

I've been writing a tutorial for LP, and I hope the Graph tutorial
will follow, but I have a problem with doctests... Something like that
:

sage: g = Graph()

Now we add a vertex ::

sage: g.add_vertex(1)

does not work as Sphinx forgets the definition of "g" between
doctests. It works fine when methods are doctested, but for some
reason a .rst file does not behave the same way :-/

Any idea how to fix it ?

Thankssssss !!!

Nathann

Nathann Cohen

unread,
Sep 1, 2010, 12:19:15 PM9/1/10
to sage-devel
(btw, this is ticket 9836)

Nathann

David Kirkby

unread,
Sep 1, 2010, 12:31:44 PM9/1/10
to sage-...@googlegroups.com
On 1 September 2010 17:16, Nathann Cohen <nathan...@gmail.com> wrote:
> Hello everybody !!!
>
> I've been writing a tutorial for LP

> Nathann

It would be good if you could update that bit of the documentation
that tells one how to load the optional GPLK package, when GLPK is now
a standard package. If you have not created a ticket for that, I think
it would be wise to do so.

I hope you enjoyed your backpacking!

Your addition of the URL for the Cliquer package got merged in the
latest rc0 - but believe it or not, it still needed still further work
after I'd positively reviewed it. (Shame on me). That took a bit more
sorting out. Mitesh reviewed my changes

Dave

Mike Hansen

unread,
Sep 1, 2010, 1:36:43 PM9/1/10
to sage-...@googlegroups.com
On Wed, Sep 1, 2010 at 9:16 AM, Nathann Cohen <nathan...@gmail.com> wrote:
> Any idea how to fix it ?

You need to use ".. link" to connect a doctest block with the one
above it. For example,

{{{
.. link

::

sage: d.items()
[(1, 5), ('sage', 17), (Integer Ring, Finite Field of size 7)]
}}}

Look in the tutorial .rst files for tons of examples.

--Mike

Nathann Cohen

unread,
Sep 4, 2010, 7:35:34 AM9/4/10
to sage-devel
> It would be good if you could update that bit of the documentation
> that tells one how to load the optional GPLK package, when GLPK is now
> a standard package. If you have not created a ticket for that, I think
> it would be wise to do so.

Patch #9836 completely removes this old file, and the new one mentions
GLPK is standard. It may have to be edited again when #9853 is merged,
but I don't except this to happen tomorrow :-D

> I hope you enjoyed your backpacking!

On my way to get a motorcycle license. Going back as soon as I can :-D

> Your addition of the  URL for the Cliquer package got merged in the
> latest rc0 - but believe it or not, it still needed still further work
> after I'd positively reviewed it. (Shame on me). That took a bit more
> sorting out. Mitesh reviewed my changes

I chose not to believe it :-D

> You need to use ".. link" to connect a doctest block with the one
> above it.

Thanksssssss !!! Ticket updated and waiting for review :-)

Nathann
Reply all
Reply to author
Forward
0 new messages