diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2011-04-05 15:01:52 -0600 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2011-04-05 17:38:00 -0600 |
commit | cfd766456368777bcb0d5edabd360b3aeb02d3f8 (patch) | |
tree | b38cd1bf7520faba8e2c0268e85253df7fe1f23f /numpy/polynomial/hermite_e.py | |
parent | a4100ba6c440bdf2a2b3cfc31995eb5e009846ee (diff) | |
download | numpy-cfd766456368777bcb0d5edabd360b3aeb02d3f8.tar.gz |
STY: Update exception style, easy ones.
Diffstat (limited to 'numpy/polynomial/hermite_e.py')
-rw-r--r-- | numpy/polynomial/hermite_e.py | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/numpy/polynomial/hermite_e.py b/numpy/polynomial/hermite_e.py index e644e345a..be3c65a32 100644 --- a/numpy/polynomial/hermite_e.py +++ b/numpy/polynomial/hermite_e.py @@ -663,9 +663,9 @@ def hermeder(cs, m=1, scl=1) : cnt = int(m) if cnt != m: - raise ValueError, "The order of derivation must be integer" + raise ValueError("The order of derivation must be integer") if cnt < 0 : - raise ValueError, "The order of derivation must be non-negative" + raise ValueError("The order of derivation must be non-negative") # cs is a trimmed copy [cs] = pu.as_series([cs]) @@ -764,11 +764,11 @@ def hermeint(cs, m=1, k=[], lbnd=0, scl=1): k = [k] if cnt != m: - raise ValueError, "The order of integration must be integer" + raise ValueError("The order of integration must be integer") if cnt < 0 : - raise ValueError, "The order of integration must be non-negative" + raise ValueError("The order of integration must be non-negative") if len(k) > cnt : - raise ValueError, "Too many integration constants" + raise ValueError("Too many integration constants") # cs is a trimmed copy [cs] = pu.as_series([cs]) @@ -1025,15 +1025,15 @@ def hermefit(x, y, deg, rcond=None, full=False, w=None): # check arguments. if deg < 0 : - raise ValueError, "expected deg >= 0" + raise ValueError("expected deg >= 0") if x.ndim != 1: - raise TypeError, "expected 1D vector for x" + raise TypeError("expected 1D vector for x") if x.size == 0: - raise TypeError, "expected non-empty vector for x" + raise TypeError("expected non-empty vector for x") if y.ndim < 1 or y.ndim > 2 : - raise TypeError, "expected 1D or 2D array for y" + raise TypeError("expected 1D or 2D array for y") if len(x) != len(y): - raise TypeError, "expected x and y to have same length" + raise TypeError("expected x and y to have same length") # set up the least squares matrices lhs = hermevander(x, deg) @@ -1041,9 +1041,9 @@ def hermefit(x, y, deg, rcond=None, full=False, w=None): if w is not None: w = np.asarray(w) + 0.0 if w.ndim != 1: - raise TypeError, "expected 1D vector for w" + raise TypeError("expected 1D vector for w") if len(x) != len(w): - raise TypeError, "expected x and w to have same length" + raise TypeError("expected x and w to have same length") # apply weights if rhs.ndim == 2: lhs *= w[:, np.newaxis] |