Policy for raising/reporting errors?

Hi there,

I just submitted a patch changing the errorhandling of Line2D on non-existant
linestyle/marker strings. Now I realize that it obviously clashes with the
current policy for reporting errors.

What happened before was that
plot(...,linestyle='garbage',...)
would verbose.report_error and set linestyle to a default, while
set_linestyle(...,linestyle='garbage')
would be silent and still set linestyle to a default.

Clearly, this is inconsistent, so there will be little argument that the
behavior should be unified. Question is, to what?

What I would expect is, that set_linestyle raises an exception if it is called
with the wrong arguments. This is, what I expect of any python library, no
matter whether it offers a GUI or not. When I work in ipython at the
commandline, I expect the errors to be displayed right there, and not be
written to a file or displayed in some window.

Obviously, this clashes with the very existance of the 'Verbose' class, used
to report errors which just writes errors to some file and goes on with work
afterwards.

The verbose.report_error approach certainly is useful within the code that is
run in the GUI-thread. Those routines that are called from outside, though,
should rather raise exception.

Furthermore, the outside functions should do as much checking on the input as
reasonably possible, so that errors are simpler to debug. Once some erraneous
input has reached the internals of matplotlib, it really is hard for the user
to guess what actually caused the error.

Ciao,
Norbert

···

--
_________________________________________Norbert Nemec
         Bernhardstr. 2 ... D-93053 Regensburg
     Tel: 0941 - 2009638 ... Mobil: 0179 - 7475199
           eMail: <Norbert@...160...>