Hi Darren,
I have updated from svn and tried to run the code. It is not working, but,
the failures have nothing to do with texmanager.py. I'm getting some of our
codes failing from within one of our __init__.py files (my guess is a naming
conflict). And some more codes failing with:
File
"/home/spxiwh/matplotlibinstall/lib64/python2.4/site-packages/matplotlib/axes.py",
line 263, in _xy_from_xy
assert nrx == nry, 'Dimensions of x and y are incompatible'
AssertionError: Dimensions of x and y are incompatible
I also get:
/home/spxiwh/matplotlibinstall/lib64/python2.4/site-packages/matplotlib/__init__.py:801:
UserWarning: This call to matplotlib.use() has no effect
because the the backend has already been chosen;
matplotlib.use() must be called *before* pylab, matplotlib.pyplot,
or matplotlib.backends is imported for the first time.
at the top of all of our plotting routine outputs now.
This sounds like we have bugs in our code, which we need to deal with before
we can upgrade our numpy and matplotlib versions. Because of time
restraints, it is likely that upgrading of these modules on our systems will
not happen for a few months. Using MPLCONFIGDIR should stop most of our
failures anyway, I guess we can solve the rest by automatically retrying
failed jobs.
Thanks for the help
Ian
2008/7/17 Darren Dale <[EMAIL PROTECTED]>:
> On Wednesday 16 July 2008 07:20:59 am Ian Harry wrote:
> > [EMAIL PROTECTED] 07:14 AM matplotlib]$ diff texmanager.py
> > /usr/lib64/python2.4/site-packages/matplotlib/texmanager.py
> > 248c248
> > < fh = file(outfile,'a')
> > ---
> >
> > > fh = file(outfile)
> >
> > 252,254c252
> > < else:
> > < try: verbose.report(fh.read(), 'debug')
> > < except: pass
> > ---
> >
> > > else: verbose.report(fh.read(), 'debug')
> >
> > 259,261c257,258
> > < else:
> > < try: os.remove(fname)
> > < except: pass
> > ---
> >
> > > else: os.remove(fname)
> >
> > 280c277
> > < fh = file(outfile,'a')
> > ---
> >
> > > fh = file(outfile)
> >
> > 285,287c282
> > < else:
> > < try: verbose.report(fh.read(), 'debug')
> > < except: pass
> > ---
> >
> > > else: verbose.report(fh.read(), 'debug')
> >
> > 289,290c284
> > < try: os.remove(outfile)
> > < except: pass
> > ---
> >
> > > os.remove(outfile)
> >
> > 314c308
> > < # else: verbose.report(fh.read(), 'debug')
> > ---
> >
> > > else: verbose.report(fh.read(), 'debug')
> >
> > --snip--
>
> I took a different approach:
>
> Index: lib/matplotlib/texmanager.py
> ===================================================================
> --- lib/matplotlib/texmanager.py (revision 5771)
> +++ lib/matplotlib/texmanager.py (working copy)
> @@ -273,16 +273,22 @@
> %(os.path.split(texfile)[-1], outfile))
> mpl.verbose.report(command, 'debug')
> exit_status = os.system(command)
> - fh = file(outfile)
> + try:
> + fh = file(outfile)
> + report = fh.read()
> + fh.close()
> + except IOError:
> + report = 'No latex error report available.'
> if exit_status:
> raise RuntimeError(('LaTeX was not able to process the
> following \
> -string:\n%s\nHere is the full report generated by LaTeX: \n\n'% repr(tex))
> +
> fh.read())
> - else: mpl.verbose.report(fh.read(), 'debug')
> - fh.close()
> +string:\n%s\nHere is the full report generated by LaTeX: \n\n'% repr(tex))
> +
> report)
> + else: mpl.verbose.report(report, 'debug')
> for fname in glob.glob(basefile+'*'):
> if fname.endswith('dvi'): pass
> elif fname.endswith('tex'): pass
> - else: os.remove(fname)
> + else:
> + try: os.remove(fname)
> + except OSError: pass
>
> return dvifile
>
> @@ -305,14 +311,19 @@
> os.path.split(dvifile)[-1], outfile))
> mpl.verbose.report(command, 'debug')
> exit_status = os.system(command)
> - fh = file(outfile)
> + try:
> + fh = file(outfile)
> + report = fh.read()
> + fh.close()
> + except IOError:
> + report = 'No dvipng error report available.'
> if exit_status:
> raise RuntimeError('dvipng was not able to \
> process the flowing file:\n%s\nHere is the full report generated by
> dvipng: \
> -\n\n'% dvifile + fh.read())
> - else: mpl.verbose.report(fh.read(), 'debug')
> - fh.close()
> - os.remove(outfile)
> +\n\n'% dvifile + report)
> + else: mpl.verbose.report(report, 'debug')
> + try: os.remove(outfile)
> + except OSError: pass
>
> return pngfile
>
>
> Would you update from svn and see if it works for you?
>
> Thanks,
> Darren
>
--
---------------------------------------------------------------------------
Ian Harry
School of Physics & Astronomy
Queens Buildings, The Parade
Cardiff, CF24 3AA
Email: [EMAIL PROTECTED]
Phone: (+44) 29 208 75120
Mobile: (+44) 7890 479090
---------------------------------------------------------------------------
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users