[SciPy-User] capturing stdout, stderr from integrate.odeint() ?

Fabrice Silva silva@lma.cnrs-mrs...
Tue Jan 15 08:35:15 CST 2013

Le lundi 14 janvier 2013 à 17:13 -0800, RKBelew a écrit :
> i'm trying to capture the various warnings being generated
> by lsoda from the FORTRAN library odepack, ala
> > lsoda--  warning..internal t (=r1) and h (=r2) are
> >        such that in the machine, t + h = t on the next step
> >        (h = step size). solver will continue anyway
> >       In above,  R1 =  0.2867368005697E+02   R2 =  0.1738483517440E-14
> my strategy has been to just redirect sys.stdout and/or sys.stderr
> to a StringIO() buffer and then explore it.  but that isn't working:
> i still get the warnings, and my buffer remains empty?
> can someone point me to where in the guts of scipy.integrate
> this might be resolved, and/or why my approach isn't working?

maybe set the full_output keyword argument to True, and get the second
output (infodict) and its 'message' item.

More information about the SciPy-User mailing list