You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(33) |
Dec
(20) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(7) |
Feb
(44) |
Mar
(51) |
Apr
(43) |
May
(43) |
Jun
(36) |
Jul
(61) |
Aug
(44) |
Sep
(25) |
Oct
(82) |
Nov
(97) |
Dec
(47) |
2005 |
Jan
(77) |
Feb
(143) |
Mar
(42) |
Apr
(31) |
May
(93) |
Jun
(93) |
Jul
(35) |
Aug
(78) |
Sep
(56) |
Oct
(44) |
Nov
(72) |
Dec
(75) |
2006 |
Jan
(116) |
Feb
(99) |
Mar
(181) |
Apr
(171) |
May
(112) |
Jun
(86) |
Jul
(91) |
Aug
(111) |
Sep
(77) |
Oct
(72) |
Nov
(57) |
Dec
(51) |
2007 |
Jan
(64) |
Feb
(116) |
Mar
(70) |
Apr
(74) |
May
(53) |
Jun
(40) |
Jul
(519) |
Aug
(151) |
Sep
(132) |
Oct
(74) |
Nov
(282) |
Dec
(190) |
2008 |
Jan
(141) |
Feb
(67) |
Mar
(69) |
Apr
(96) |
May
(227) |
Jun
(404) |
Jul
(399) |
Aug
(96) |
Sep
(120) |
Oct
(205) |
Nov
(126) |
Dec
(261) |
2009 |
Jan
(136) |
Feb
(136) |
Mar
(119) |
Apr
(124) |
May
(155) |
Jun
(98) |
Jul
(136) |
Aug
(292) |
Sep
(174) |
Oct
(126) |
Nov
(126) |
Dec
(79) |
2010 |
Jan
(109) |
Feb
(83) |
Mar
(139) |
Apr
(91) |
May
(79) |
Jun
(164) |
Jul
(184) |
Aug
(146) |
Sep
(163) |
Oct
(128) |
Nov
(70) |
Dec
(73) |
2011 |
Jan
(235) |
Feb
(165) |
Mar
(147) |
Apr
(86) |
May
(74) |
Jun
(118) |
Jul
(65) |
Aug
(75) |
Sep
(162) |
Oct
(94) |
Nov
(48) |
Dec
(44) |
2012 |
Jan
(49) |
Feb
(40) |
Mar
(88) |
Apr
(35) |
May
(52) |
Jun
(69) |
Jul
(90) |
Aug
(123) |
Sep
(112) |
Oct
(120) |
Nov
(105) |
Dec
(116) |
2013 |
Jan
(76) |
Feb
(26) |
Mar
(78) |
Apr
(43) |
May
(61) |
Jun
(53) |
Jul
(147) |
Aug
(85) |
Sep
(83) |
Oct
(122) |
Nov
(18) |
Dec
(27) |
2014 |
Jan
(58) |
Feb
(25) |
Mar
(49) |
Apr
(17) |
May
(29) |
Jun
(39) |
Jul
(53) |
Aug
(52) |
Sep
(35) |
Oct
(47) |
Nov
(110) |
Dec
(27) |
2015 |
Jan
(50) |
Feb
(93) |
Mar
(96) |
Apr
(30) |
May
(55) |
Jun
(83) |
Jul
(44) |
Aug
(8) |
Sep
(5) |
Oct
|
Nov
(1) |
Dec
(1) |
2016 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(3) |
Sep
(1) |
Oct
(3) |
Nov
|
Dec
|
2017 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
(7) |
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: John H. <jdh...@ac...> - 2004-11-19 15:23:57
|
>>>>> "Steve" == Steve Chaplin <ste...@ya...> writes: Steve> At the moment we have error_msg(), the Verbose class and Steve> exceptions all working in the same area and a bit of Steve> confusion as to which one does what. I don't think we need Steve> all three. Steve> I suggest - using exceptions to handle errors that may Steve> terminate the program, and allowing the matlab interface, Steve> GUI backends and user scripts to catch these exceptions. - Steve> using verbose for all reporting - merging error_msg() into Steve> the Verbose class (with the GUI backends possibly Steve> subclassing Verbose to provide a popup error dialog) I think you are right that the plethora of error reporting strategies is causing confusion, especially for me! I like the idea of the GUI backends overriding placing a hook into the python exception handling process. One possibility would be to do away with verbose.report_error and error_msg. The GUIs hook into the exception message, and anywhere we want to report an error we raise a python exception. And we continue to use verbose.report as before. I just checked backend_ps and the only place is uses error_msg is error_msg_ps('Could not open %s for writing' % outfile) which would be more naturally handled as an exception anyway. Steve, could you look into hooking a GTK dialog into the python exception reporting mechanism to see if this is viable? In summary, the thought is * use verbose only for non-error reporting * use exceptions for all error reporting * work some GUI magic to transparently get the errors forwarded to a dialog box w/o using special functions As for verbose.report, I'm not convinced it is a good idea to hook this into the GUI. For one thing, some reporting occurs before the backend is determined. For another, it would also require some caching of messages because if 30 messages generate 30 popups it will get annoying quick. These things are manageable, but I think the main use for verbose.report is debugging a problem, in which case simply having the messages go to a stdout or a file may be the best place for them. JDH |
From: Steve C. <ste...@ya...> - 2004-11-19 09:24:08
|
On Thu, 2004-11-18 at 18:05 +0000, Jochen Voss wrote: > 4) some ideas: > > - The backends could return errors via python standard exceptions > without printing messages and such. This leads to simple code, > feels quite Pythonic, makes the backends more independent of the > error reporting policy and at the moment seems to be the only sane > solution to me. > > - The backends should have a function which the matlab interface can > call to report errors to the user. This should pop up a dialog > etc. on GUI backends and just print the message to stderr for > non-GUI backends. It should not terminate the program. I agree with these ideas. > 7) Conclusions: > > I suggest the following. > > - Change backend_template.py and all the other non-GUI backends to > > def error_msg_ps(msg, *args): > """ > Signal an error condition. > """ > sys.stderr.write('Error: %s' % msg) I'd prefer to merge error_msg into the Verbose class, or just delete it. > - Change all callers of error_msg to terminate the program after the > call when appropriate Agree > - Remove the verbose.report_error function and replace it with Python > exceptions etc. Agree > What do you think? At the moment we have error_msg(), the Verbose class and exceptions all working in the same area and a bit of confusion as to which one does what. I don't think we need all three. I suggest - using exceptions to handle errors that may terminate the program, and allowing the matlab interface, GUI backends and user scripts to catch these exceptions. - using verbose for all reporting - merging error_msg() into the Verbose class (with the GUI backends possibly subclassing Verbose to provide a popup error dialog) Steve |
From: Fernando P. <Fer...@co...> - 2004-11-18 18:57:30
|
John Hunter schrieb: > try : save_ps(fname) > except IOError, msg: > verbose.report_error('Backend PS failed to save %s'%fname) > raise IOError(msg) Just 'raise' is enough, python by default will re-raise the original exception untouched. I'll leave this discussion to you guys, I don't know the matplotlib code enough to contribute anything really useful. My only point is that reusing SystemExit for other purposes, with additional information encoded in the message, is IMHO a bad idea. There's a reason why exceptions make up a class hierarchy: this allows you to use classes for the flow control mechanisms, leaving the string messages simply as additional information mainly for the user. Since these messages are potentially locale-sensitive, and can change over time (spelling, capitalization, etc), it's just not a good idea to base code behaviour on them. Cheers, f |
From: Jochen V. <vo...@se...> - 2004-11-18 18:06:00
|
Hello, I tried to think a little bit more systematically about the way error conditions and messages are passed around in matplotlib. 1) There see to be several kinds of object: - informational messages like the output of --verbose-debug-annoying - error messages which the matlab interface passes to the backends to have them displayed to the user - error conditions reported by the backends to the caller 2) Typical scenarios: a) A user tries to debug some installation problem by using the --verbose-debug-annoying option or similar. This generates potentially a lot of messages which should shown to the user. Dumping them all to stdout or stderr seems fine here. b) A script calls the matlab interface functions with invalid arguments. The user should get an error message. In a GUI backend this error message might pop up in a message window or similar. c) A backend encounters an error condition, e.g. if it cannot open the file, cannot load a font etc. If a GUI backend is active the error message should be displayed by the GUI backend, otherwise it should be printed to stderr or similar. Is this so far correct? 3) Required or almost required properties of the implementation: - the user should be able to customise how much information he sees, e.g. by using the --verbose-* options - The GUI backends should not be terminated if there is an error while saving a file etc. 4) some ideas: - The backends could return errors via python standard exceptions without printing messages and such. This leads to simple code, feels quite Pythonic, makes the backends more independent of the error reporting policy and at the moment seems to be the only sane solution to me. - The backends should have a function which the matlab interface can call to report errors to the user. This should pop up a dialog etc. on GUI backends and just print the message to stderr for non-GUI backends. It should not terminate the program. Rationale for not calling verbose.report_error in this function: the GUI backend reports the error on its own (dialog, status line, etc), so it does not need to use verbose.report_error additionally. When the PostScript backend is called from the GUI backend, then the GUI backends error report function will be used, what PostScript does does not matter. In all other cases displaying the error message to stderr seems the only useful thing to do (e.g. disabling it is not useful). 5) the verbose.report mechanism: At the moment I am not sure how this fits in here. Maybe it should only be used for non-error messages? What is configurable here? The user can choose the amount of messages he wants to see. Anything else? 6) Analysis of the three scenarios above: a) --verbose-* output: Here the flow of control is straightforward. At random places there are calls to verbose.report. These are either discarded or printed to stdout. This is currently done by the Verbose class. b) invalid arguments Again, this is simple: the matlab interface calls error_msg, the GUI backend does something useful with the message. c) backend error conditions This seems to be the most complex scenario. I think this should work as follows: the backend raises the standard Python exception, e.g IOError. If the GUI backend calls the PostScript backend, it should catch any exception from the PostScript backend call, and tell the user about it. If the user in a script calls e.g. "savefig('/fig1.eps')" and has no write permission for the root directory, then he will get the Python exception and can do with it whatever he likes. 7) Conclusions: I suggest the following. - Change backend_template.py and all the other non-GUI backends to def error_msg_ps(msg, *args): """ Signal an error condition. """ sys.stderr.write('Error: %s' % msg) Maybe even make this function a class method of the FigureManagerBase class? (the "error_msg =3D error_msg_..." assignments seem hackish.) - Change all callers of error_msg to terminate the program after the call when appropriate - Remove the verbose.report_error function and replace it with Python exceptions etc. What do you think? Jochen --=20 http://seehuhn.de/ |
From: John H. <jdh...@ac...> - 2004-11-18 17:00:16
|
>>>>> "Jochen" == Jochen Voss <vo...@se...> writes: Jochen> Sorry, I am still not clear about this function. What is Jochen> its purpose? When will it be called? Good question. In simple cases the matlab interface calls this function if illegal arguments are passed, eg if you call axis with the wrong signature if len(v) != 4: error_msg('v must contain [xmin xmax ymin ymax]') return This just displays the error and returns, non-fatal. In other functions, it does forwards the traceback message on to the error_msg function and then re-raises. This is done to prevent the gui from swallowing the traceback. But there is no coherent policy in the matlab interface in how error handling is done. Eg, in savefig, which calls print_figure for key in ('dpi', 'facecolor', 'edgecolor'): if not kwargs.has_key(key): kwargs[key] = rcParams['savefig.%s'%key] manager = get_current_fig_manager() manager.canvas.print_figure(*args, **kwargs) There is no try/except handling of print_figure. The leads to the question: which exceptions should the matlab interface handle when calling the backend? Do we do the extra work of defining the exception policy of backend functions and just catch these. Or do we catch all exceptions, forward the exception message to error_msg, and then re-raise the identical exception. The latter sounds reasonably coherent. Or do we start over with a new design? Wandering into murky waters here, is it possible for the GUIs simply to add an exception hook to hook the tracebacks into a GUI dialog box, and simply do away with error_msg all-together? I'm starting to like the sound of that. JDH |
From: Jochen V. <vo...@se...> - 2004-11-18 16:44:12
|
Hello John, On Thu, Nov 18, 2004 at 10:24:57AM -0600, John Hunter wrote: > I suggest we rework the image backends to not define an error message > function at all, but simply to import and reuse the one from > backend_bases. This will make it easier to change the policy in a > single place. Secondly, an image backend should never call this > function, it should be reserved for the matlab interface simply to > insure a consistent interface between the various backends. Sorry, I am still not clear about this function. What is its purpose? When will it be called? > Thirdly, the image backends should verbose.report/report_error where > appropriate, and raise when indicated. GUI backends can catch these > exceptions and handle them how they want. This sounds fine for me. All the best, Jochen --=20 http://seehuhn.de/ |
From: John H. <jdh...@ac...> - 2004-11-18 16:25:09
|
>>>>> "Steve" == Steve Chaplin <ste...@ya...> writes: Steve> I tried this calling the SVG backend directly and by Steve> switching to the SVG backend from the GTK backend and it Steve> works OK. This gets back to our previous unresolved discussion on error handling in the image backends. I think the way it is done now is a historical accident. In the olden days, pre matplotlib-0.50, there was no ability to switch backends, or to use an image backend within a GUI (eg gtkcairo, gtkagg). So the image backends were free-standing and their error handling didn't have much impact outside their own scope. Now they clearly do. The second design problem was that I preferred simple error messages rather than exceptions with tracebacks. This grew out of my experience with users of my GUIs who basically will not read a traceback - they appear to have blinders on. However, they will read a simple message like Could not save file blah, blah, blah. But as we are seeing, this approach (simple message, SystemExit) doesn't scale well and isn't appropriate when GUIs are calling image backends. I suggest we rework the image backends to not define an error message function at all, but simply to import and reuse the one from backend_bases. This will make it easier to change the policy in a single place. Secondly, an image backend should never call this function, it should be reserved for the matlab interface simply to insure a consistent interface between the various backends. Thirdly, the image backends should verbose.report/report_error where appropriate, and raise when indicated. GUI backends can catch these exceptions and handle them how they want. In the case at hand, it might be sensible for backend ps to catch an IO Error, report to verbose report_error, and then rethrow the error with the message. Something like try : save_ps(fname) except IOError, msg: verbose.report_error('Backend PS failed to save %s'%fname) raise IOError(msg) Thoughts? JDH |
From: Jochen V. <vo...@se...> - 2004-11-18 16:22:06
|
Hello Steve, On Thu, Nov 18, 2004 at 11:38:10PM +0800, Steve Chaplin wrote: > At the moment the PS backend does > try: > fh =3D file(outfile, 'w') > except IOError: > error_msg_ps('Could not open %s for writing' % outfile) >=20 > which translates into > try: > fh =3D file(outfile, 'w') > except IOError: > verbose.report_error('Error: Could not open %s for writing' % > outfile) > sys.exit() >=20 > The backend does not do any cleanup after the exception, so I think it > could be changed to just > fh =3D file(outfile, 'w') As I understood John, the plan is to report error messages via the verbose.report_error function. Where would this be called with the modified code (especially when there is no GUI backend active)? > allowing the exception terminate the program with the error message > appearing at the end of the traceback. This looks really ugly to me. But maybe it is the script author's responsibility to catch this if he cares about this. > Then the GUI backends can then do > from backend_svg import FigureCanvasSVG as FigureCanvas > try: > fc =3D self.switch_backends(FigureCanvas) > fc.print_figure(filename, dpi, facecolor, edgecolor, > orientation) > except IOError, exc: > error_msg("%s: %s" % (exc.filename, exc.strerror), parent=3Dself) What about other exceptions thrown by the backend? I see that passing the original exception to the caller is cleaner and I would be happy to change the PostScript backend to do this. The only question for me is: how and when is the "report_error" function to be used? All the best, Jochen --=20 http://seehuhn.de/ |
From: Steve C. <ste...@ya...> - 2004-11-18 15:36:50
|
On Wed, 2004-11-17 at 10:54 -0700, Fernando Perez wrote: > Jochen Voss schrieb: > > Hello Steve, > > > > On Wed, Nov 17, 2004 at 11:00:32PM +0800, Steve Chaplin wrote: > > > >>I don't think failure to save a file should be a fatal error. > >>Perhaps PS/SVG print_figure() could raise an exception for the GUI > >>backend to catch so it can popup an error message and continue. > > > > Even now you can probably (not tried) catch the SystemExit > > exception and prevent the program from aborting. > > Do you think raising SystemExit like > > > > raise SystemExit("error while writing file: permission denied") > > > > would be good enough. The GUI frontend could catch SystemExit, > > check whether the associated value is a string, and then display > > this string in an error message box. > > > > What do you think? > > Bad design. Doing exception analysis based on string matching for the message > is very brittle. A single change in capitalization of the message can break > things down the road. > > It's _far_ better to either: > > 1. have the ps/svg backends do whatever cleanup they want, and then reraise > the original exception unchanged > > 2. or simply make a matplotlib.SaveError exception which can be explicitly > caught based on class matching, which is the preferred python way of doing this. > > Best, > > f At the moment the PS backend does try: fh = file(outfile, 'w') except IOError: error_msg_ps('Could not open %s for writing' % outfile) which translates into try: fh = file(outfile, 'w') except IOError: verbose.report_error('Error: Could not open %s for writing' % outfile) sys.exit() The backend does not do any cleanup after the exception, so I think it could be changed to just fh = file(outfile, 'w') allowing the exception terminate the program with the error message appearing at the end of the traceback. Then the GUI backends can then do from backend_svg import FigureCanvasSVG as FigureCanvas try: fc = self.switch_backends(FigureCanvas) fc.print_figure(filename, dpi, facecolor, edgecolor, orientation) except IOError, exc: error_msg("%s: %s" % (exc.filename, exc.strerror), parent=self) I tried this calling the SVG backend directly and by switching to the SVG backend from the GTK backend and it works OK. Steve |
From: Jochen V. <vo...@se...> - 2004-11-18 11:57:35
|
Hello, On Wed, Nov 17, 2004 at 10:54:49AM -0700, Fernando Perez wrote: > Bad design. Doing exception analysis based on string matching for the=20 > message is very brittle. A single change in capitalization of the messag= e=20 > can break things down the road. Sorry, maybe I was not clear enough. What I tried to suggest was: 1) GUI backends should catch the SystemExit exception from the PS backend, thus being able to continue running even if the backend aborts with an error. 2) GUI backends should in case that they caught a SystemExit exception notify the user that saving the figure as PostScript failed. If the exception is associated with an error message string, they could display this string to the user. > 1. have the ps/svg backends do whatever cleanup they want, and then rerai= se=20 > the original exception unchanged >=20 > 2. or simply make a matplotlib.SaveError exception which can be explicitl= y=20 > caught based on class matching, which is the preferred python way of doin= g=20 > this. Maybe. But how is any information except "the backend failed with error message ..." useful to the GUI? Would it act differently on an font-not-found condition then it would on a save-failed one? All the best, Jochen --=20 http://seehuhn.de/ |
From: Fernando P. <Fer...@co...> - 2004-11-17 17:54:54
|
Jochen Voss schrieb: > Hello Steve, > > On Wed, Nov 17, 2004 at 11:00:32PM +0800, Steve Chaplin wrote: > >>I don't think failure to save a file should be a fatal error. >>Perhaps PS/SVG print_figure() could raise an exception for the GUI >>backend to catch so it can popup an error message and continue. > > Even now you can probably (not tried) catch the SystemExit > exception and prevent the program from aborting. > Do you think raising SystemExit like > > raise SystemExit("error while writing file: permission denied") > > would be good enough. The GUI frontend could catch SystemExit, > check whether the associated value is a string, and then display > this string in an error message box. > > What do you think? Bad design. Doing exception analysis based on string matching for the message is very brittle. A single change in capitalization of the message can break things down the road. It's _far_ better to either: 1. have the ps/svg backends do whatever cleanup they want, and then reraise the original exception unchanged 2. or simply make a matplotlib.SaveError exception which can be explicitly caught based on class matching, which is the preferred python way of doing this. Best, f |
From: Jochen V. <vo...@se...> - 2004-11-17 15:34:12
|
Hello Steve, On Wed, Nov 17, 2004 at 11:00:32PM +0800, Steve Chaplin wrote: > I don't think failure to save a file should be a fatal error. > Perhaps PS/SVG print_figure() could raise an exception for the GUI > backend to catch so it can popup an error message and continue. Even now you can probably (not tried) catch the SystemExit exception and prevent the program from aborting. Do you think raising SystemExit like raise SystemExit("error while writing file: permission denied") would be good enough. The GUI frontend could catch SystemExit, check whether the associated value is a string, and then display this string in an error message box. What do you think? Jochen --=20 http://seehuhn.de/ |
From: Steve C. <ste...@ya...> - 2004-11-17 14:59:21
|
I've noticed a problem as follows: You run a GUI backend (GTK, GTKAgg etc) and want to save a figure. You select the toolbar save button and type in a .ps or .svg filename and select save. The GUI backend switches to the PS/SVG backend to save the file. If there is a problem saving the file, for example you do not have write permission to the directory, PS/SVG backends will kill your GUI application with sys.exit() I don't think failure to save a file should be a fatal error. Perhaps PS/SVG print_figure() could raise an exception for the GUI backend to catch so it can popup an error message and continue. Steve |
From: Norbert N. <Nor...@gm...> - 2004-11-17 10:22:51
|
Hi there, again a few patches, mostly independent but somewhat interconnected: axes-kwargs: a general cleanup of the code in axes.py - in several places, kwargs was handled inconsistently, ignoring surplus arguments. I went through all uses of kwargs and made sure that every argument is either used or reported as error legend-fontsize: a tiny hack to make Legend respect the FONTSIZE parameter correctly. (up to now, it was plainly ignored) legend-kwargs: have Legend.__init__ respect a bunch of kwargs, overriding the global defaults. Also Axes.legend passes these arguments through correctly Ciao, Norbert -- _________________________________________Norbert Nemec Bernhardstr. 2 ... D-93053 Regensburg Tel: 0941 - 2009638 ... Mobil: 0179 - 7475199 eMail: <No...@Ne...> |
From: Jochen V. <vo...@se...> - 2004-11-13 11:44:03
|
Hello Steve, On Sat, Nov 13, 2004 at 06:38:57PM +0800, Steve Chaplin wrote: > I used the PS-backend today and I think there's a problem with landscape > plots. When I view the PS files with 'gv' it looks like the bounding box > is landscape but the figure is drawn as portrait. Thanks for catching this. It can be fixed with the following patch (already in CVS): =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- backend_ps.py.~1.12.~ 2004-11-10 23:50:32.000000000 +0000 +++ backend_ps.py 2004-11-13 11:34:20.000000000 +0000 @@ -558,6 +558,7 @@ =20 if isLandscape: xo, yo =3D 72*paperHeight - yo, xo + llx, lly, urx, ury =3D lly, llx, ury, urx rotation =3D 90 else: rotation =3D 0 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D All the best, Jochen --=20 http://seehuhn.de/ |
From: Steve C. <ste...@ya...> - 2004-11-13 10:38:43
|
On Fri, 2004-11-12 at 20:22 -0800, matplotlib-devel- re...@li... wrote: > I checked in the patch yesterday evening. The patch decreased the > total size of the PostScript files generated by backend_driver.py from > 37MB to 31MB. > > All the best, > Jochen > --=20 > http://seehuhn.de/ Jochen, I used the PS-backend today and I think there's a problem with landscape plots. When I view the PS files with 'gv' it looks like the bounding box is landscape but the figure is drawn as portrait. Regards, Steve |
From: Jochen V. <vo...@se...> - 2004-11-12 15:44:55
|
Hello, On Thu, Nov 11, 2004 at 09:30:31AM -0600, John Hunter wrote: > >>>>> "Jochen" =3D=3D Jochen Voss <vo...@se...> writes: >=20 > Jochen> I have another (more intrusive) patch ready, which strips > Jochen> down the PostScript file size even more by removing about > Jochen> 20 million gsave/grestore pairs per figure. I tried the > Jochen> backend_driver script and the patch seems to work. Can I > Jochen> also check this in, or should I be stabilising the > Jochen> PostScript backend at the moment? >=20 > If it passes backend driver and appears logically correct to you, > check it in. I added those 20 million pairs to be on the safe side > when I wrote the PS backend, but was never very happy about them. I checked in the patch yesterday evening. The patch decreased the total size of the PostScript files generated by backend_driver.py from 37MB to 31MB. All the best, Jochen --=20 http://seehuhn.de/ |
From: Fernando P. <Fer...@co...> - 2004-11-11 16:53:56
|
John Hunter wrote: >>>>>>"Jochen" == Jochen Voss <vo...@se...> writes: > > > Jochen> Hello, I am very sorry about this, but I messed up the PS > Jochen> backend shortly before the release :-( While trying to [...] > No worries, we're used to doing bug fix releases around here. Better > that you caught it than some irate gnuplot user who comes around here > complaining about matplotlib's PS file sizes :-) hey! I was nice when I asked! ;) Best, f |
From: John H. <jdh...@ac...> - 2004-11-11 15:40:23
|
>>>>> "Jochen" == Jochen Voss <vo...@se...> writes: Jochen> I have another (more intrusive) patch ready, which strips Jochen> down the PostScript file size even more by removing about Jochen> 20 million gsave/grestore pairs per figure. I tried the Jochen> backend_driver script and the patch seems to work. Can I Jochen> also check this in, or should I be stabilising the Jochen> PostScript backend at the moment? If it passes backend driver and appears logically correct to you, check it in. I added those 20 million pairs to be on the safe side when I wrote the PS backend, but was never very happy about them. JDH |
From: Jochen V. <vo...@se...> - 2004-11-11 15:34:05
|
Hello John, On Thu, Nov 11, 2004 at 08:12:00AM -0600, John Hunter wrote: > No worries, we're used to doing bug fix releases around here. Better > that you caught it than some irate gnuplot user who comes around here > complaining about matplotlib's PS file sizes :-) Well, everything is of course still dominated by the huge included fonts, so they will probably not notice ;-) Maybe I can start doing something about this during the week-end. Let's see ... > Just commit the patch and in a few days as we iron out any remaining > bugs that are discovered I'll post a bug fix release. The patch is already in CVS. I have another (more intrusive) patch ready, which strips down the PostScript file size even more by removing about 20 million gsave/grestore pairs per figure. I tried the backend_driver script and the patch seems to work. Can I also check this in, or should I be stabilising the PostScript backend at the moment? All the best, Jochen --=20 http://seehuhn.de/ |
From: John H. <jdh...@ac...> - 2004-11-11 14:21:49
|
>>>>> "Jochen" == Jochen Voss <vo...@se...> writes: Jochen> Hello, I am very sorry about this, but I messed up the PS Jochen> backend shortly before the release :-( While trying to Jochen> move a block of code I duplicated it instead. The Jochen> consequence is, that PostScript files generated with Jochen> matplotlib 0.64 draw every bit of the figure twice. The Jochen> output is still ok, but it is generated in an inefficient Jochen> way. Jochen> Luckily at least the huge PostScript fonts are only Jochen> included once. Jochen> Again, I am very sorry about this, Jochen -- No worries, we're used to doing bug fix releases around here. Better that you caught it than some irate gnuplot user who comes around here complaining about matplotlib's PS file sizes :-) Just commit the patch and in a few days as we iron out any remaining bugs that are discovered I'll post a bug fix release. JDH |
From: Jochen V. <vo...@se...> - 2004-11-11 13:15:08
|
Hello, I am very sorry about this, but I messed up the PS backend shortly before the release :-( While trying to move a block of code I duplicated it instead. The consequence is, that PostScript files generated with matplotlib 0.64 draw every bit of the figure twice. The output is still ok, but it is generated in an inefficient way. Luckily at least the huge PostScript fonts are only included once. The problem can be fixed with the following patch =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D diff -u -r1.10 backend_ps.py --- backend_ps.py 5 Nov 2004 11:05:14 -0000 1.10 +++ backend_ps.py 11 Nov 2004 13:08:43 -0000 @@ -585,16 +585,6 @@ =20 # write the figure print >>fh, renderer.get_ps() - origfacecolor =3D self.figure.get_facecolor() - origedgecolor =3D self.figure.get_edgecolor() - self.figure.set_facecolor(facecolor) - self.figure.set_edgecolor(edgecolor) - - renderer =3D RendererPS(width, height, fh) - self.figure.draw(renderer) - - self.figure.set_facecolor(origfacecolor) - self.figure.set_edgecolor(origedgecolor) =20 # write the trailer print >>fh, "grestore" =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Again, I am very sorry about this, Jochen --=20 http://seehuhn.de/ |
From: Jochen V. <vo...@se...> - 2004-11-11 12:53:46
|
Hello John, On Thu, Nov 11, 2004 at 06:22:11AM -0600, John Hunter wrote: > This looks very good and will remove a pesky problem, so yes, plase > commit it. Can we build tk w/o an X11 connection. If memory serves, > there was an X requirement for tk.. My patch only fixes GTK and GtkAgg. I do not know much about tk, but maybe a similar patch will help there? All the best, Jochen --=20 http://seehuhn.de/ |
From: John H. <jdh...@ac...> - 2004-11-11 12:32:00
|
>>>>> "Jochen" == Jochen Voss <vo...@se...> writes: Jochen> Hello, currently the GTK backends for matplotlib won't Jochen> build without an X-server connection. The following patch Jochen> fixes this: Jochen> It makes use of the fact the the import of gtk fails with Jochen> an RuntimeError instead of an ImportError when the module Jochen> is present but not X-server is there. Do you think that Jochen> this is safe to commit? Or will it have unwanted Jochen> side-effects? Jochen> I hope this helps, Jochen -- http://seehuhn.de/ Hi Jochen This looks very good and will remove a pesky problem, so yes, plase commit it. Can we build tk w/o an X11 connection. If memory serves, there was an X requirement for tk.. JDH |
From: Jochen V. <vo...@se...> - 2004-11-11 09:56:35
|
Hello, currently the GTK backends for matplotlib won't build without an X-server connection. The following patch fixes this: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- setup.py 4 Nov 2004 15:58:57 -0000 1.108 +++ setup.py 11 Nov 2004 09:54:24 -0000 @@ -122,11 +122,16 @@ build_transforms(ext_modules, packages, NUMERIX) =20 if BUILD_GTKAGG: - try: import gtk - except ImportError: print 'GTKAgg requires pygtk' - else: - BUILD_AGG =3D 1 - build_gtkagg(ext_modules, packages) + try: + import gtk + except ImportError: + print 'GTKAgg requires pygtk' + BUILD_GTKAGG=3D0 + except RuntimeError: + print 'pygtk present but import failed' +if BUILD_GTKAGG: + BUILD_AGG =3D 1 + build_gtkagg(ext_modules, packages) =20 if BUILD_TKAGG: try: import Tkinter =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D It makes use of the fact the the import of gtk fails with an RuntimeError instead of an ImportError when the module is present but not X-server is there. Do you think that this is safe to commit? Or will it have unwanted side-effects? I hope this helps, Jochen --=20 http://seehuhn.de/ |