From bc01dee3df3a46e9c032ee55749f3aa5343a9531 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Sun, 21 Feb 2010 03:34:02 +0000 Subject: STY: Use import numpy as np. This seems to fix an import error introduced by 2to3, but that may have been an artifact from a previous build. In anycase, no harm done. --- numpy/numarray/util.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'numpy/numarray') diff --git a/numpy/numarray/util.py b/numpy/numarray/util.py index 64a3f1711..9b4ffd619 100644 --- a/numpy/numarray/util.py +++ b/numpy/numarray/util.py @@ -1,16 +1,24 @@ import os -import numpy +import numpy as np __all__ = ['MathDomainError', 'UnderflowError', 'NumOverflowError', 'handleError', 'get_numarray_include_dirs'] -class MathDomainError(ArithmeticError): pass -class UnderflowError(ArithmeticError): pass -class NumOverflowError(OverflowError, ArithmeticError): pass +class MathDomainError(ArithmeticError): + pass + + +class UnderflowError(ArithmeticError): + pass + + +class NumOverflowError(OverflowError, ArithmeticError): + pass + def handleError(errorStatus, sourcemsg): """Take error status and use error mode to handle it.""" - modes = numpy.geterr() + modes = np.geterr() if errorStatus & numpy.FPE_INVALID: if modes['invalid'] == "warn": print "Warning: Encountered invalid numeric result(s)", sourcemsg -- cgit v1.2.1