Author: bugman Date: Fri Nov 22 19:33:54 2013 New Revision: 21613 URL: http://svn.gna.org/viewcvs/relax?rev=21613&view=rev Log: Created the --numpy-raise command line option. When this is set, all numpy warnings will be converted to errors. This is to aid in debugging to locate where the warning messages are coming from. These appear as RelaxWarnings, but there is no indication as to where the problem is. Modified: trunk/relax.py Modified: trunk/relax.py URL: http://svn.gna.org/viewcvs/relax/trunk/relax.py?rev=21613&r1=21612&r2=21613&view=diff ============================================================================== --- trunk/relax.py (original) +++ trunk/relax.py Fri Nov 22 19:33:54 2013 @@ -40,6 +40,7 @@ import dep_check # Python modules. +import numpy from optparse import Option, OptionParser from os import F_OK, access, getpid, putenv if dep_check.cprofile_module: @@ -289,13 +290,16 @@ parser.add_option('-v', '--version', action='store_true', dest='version', default=0, help='show the version number and exit') parser.add_option('-m', '--multi', action='store', type='string', dest='multiprocessor', default='uni', help='set multi processor method') parser.add_option('-n', '--processors', action='store', type='int', dest='n_processors', default=-1, help='set number of processors (may be ignored)') + parser.add_option('--numpy-raise', action='store_true', dest='numpy_raise', default=0, help='convert numpy warnings to errors') # Parse the options. (options, args) = parser.parse_args() - # Debugging flag. + # Debugging flag (and numpy warning to error conversion). if options.debug: status.debug = True + if options.numpy_raise: + numpy.seterr(all='raise') # Pedantic flag. if options.pedantic: