Hi Greg,

On Tue, Jul 15, 2008 at 8:58 PM, Greg Novak <novak@ucolick.org> wrote:
I use Python as a interactive data analysis environment.  That is, I
use the IPython enhanced interactive shell and have sessions that run
to hundreds or thousands of commands, loading data, plotting it,
transforming it, plotting again, etc.

However, this usage pattern is hampered by the fact that if I leave
PyX alone for ~2 minutes and then try to plot something, PyX always
seems to have lost contact with its TeX process and I get backtraces:

<class 'pyx.text.TexResultError'>: TeX didn't respond as expected
within the timeout period (60 seconds).

Then I have to quit python, restart, load all my data and functions,
and then start working again.

I've used PyX like this for a long time, and in the past ~once per day
or so I'd lose contact with TeX, and ~80 percent of the time I could
reestablish contact via some combination of:

1) pyx.text.reset()
2) pyx.text.reset(reinit=True)
3) dreload(pyx)
4) a function I wrote that reloads all loaded modules
5) a function I wrote that deletes all of the pyx modules from
sys.modules, imports, PyX, then reimports all other modules that use
PyX (intended to try to get all of the references to the old modules)

However, now none of these things work for me. 
[...]

Did you try already to define a texrunner-object from pyx, in order to
communicate with tex? I'm not sure whether it will solve your problem, but
at least it should be possible by re-initializing the texrunner to restart tex,
thus establishing a new connection. Thus, I would propose to try something like

pyx.defaulttexrunner= pyx.texrunner()

in order to restart tex.

Maybe it works?

Axel