mailRe: RelaxWarnings and RelaxErrors.


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by Edward d'Auvergne on August 11, 2006 - 10:58:
On 8/11/06, Chris MacRaild wrote:
On Thu, 2006-08-10 at 20:37 +1000, Edward d'Auvergne wrote:
> I've implemented a rudimentary warning system for relax (the
> relax-commits mailing list message is at
> https://mail.gna.org/public/relax-commits/2006-08/msg00004.html).  Is
> this similar to what you were thinking about zero bond length warning?
>  It could use a lot of tweaking.  What do you think of the idea of
> having two new relax command line flags, '--ignore-errors' which
> causes errors to be printed but the program continues execution and
> '--pedantic' which escalates the warning into an error?  It might be
> difficult as it may require the dropping of the use of the Python
> Exception and Warning classes and implementing two relax specific
> types which when using these two flags can inter convert with each
> other (i.e. errors become warnings and vice versa).

I like the look of the RelaxWarnings.
'--ignore-errors' and '--pedantic' options wouldn't be a huge priority
from my point of view, especially if they involve dropping out of the
Python Exception-handling machinery. There might be other ways of doing
it if others think these options are worthwhile.

You can escalate the warnings to errors, not so sure about doing the opposite. The Python warning system seems arcane and there doesn't seem to be any similarity between the error and warning systems (which is a pain). As for RelaxWarnings, there is plenty of scope for expanding it. For example in the 'generic_fns/pdb.py' file there are a few print messages that could be translated to RelaxWarnings. I haven't checked elsewhere but I'm sure there are hundreds of points in the program where print statements can be translated to specific RelaxWarnings. It would standardise the messages printed and you could then easily grep the stuff that goes to stderr. Oh, and the warnings are shifted from stdout to stderr.

The more important issue as far as I'm concerned is ensuring that the
default behaviour doesn't raise Errors when Warnings will do.

I've generally used print statements for these situations.

Edward



Related Messages


Powered by MHonArc, Updated Sat Aug 12 08:20:34 2006