Skip to content

Commit

Permalink
MAINT: Minor code edits.
Browse files Browse the repository at this point in the history
  • Loading branch information
chebee7i committed Feb 23, 2015
1 parent c2681a5 commit a3b7aa5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions numpy/core/numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -2337,10 +2337,11 @@ def within_tol(x, y, atol, rtol):
x = array(a, copy=False, subok=True, ndmin=1)
y = array(b, copy=False, subok=True, ndmin=1)

# make sure y is an inexact type to avoid abs(MIN_INT); will cause
# casting of x later. Make sure to allow subclasses (e.g., for numpy.ma).
dtype = multiarray.result_type(y, 1.)
y = array(y, dtype=dtype, copy=False, subok=True)
# Make sure y is an inexact type to avoid bad behavior on abs(MIN_INT).
# This will cause casting of x later. Also, make sure to allow subclasses
# (e.g., for numpy.ma).
dt = multiarray.result_type(y, 1.)
y = array(y, dtype=dt, copy=False, subok=True)

xfin = isfinite(x)
yfin = isfinite(y)
Expand Down
2 changes: 1 addition & 1 deletion numpy/testing/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,7 @@ def assert_allclose(actual, desired, rtol=1e-7, atol=0, equal_nan=False,
import numpy as np
def compare(x, y):
return np.core.numeric.isclose(x, y, rtol=rtol, atol=atol,
equal_nan=equal_nan)
equal_nan=equal_nan)

actual, desired = np.asanyarray(actual), np.asanyarray(desired)
header = 'Not equal to tolerance rtol=%g, atol=%g' % (rtol, atol)
Expand Down

0 comments on commit a3b7aa5

Please sign in to comment.