def assert_hypot_isnan(x, y): err = np.seterr(invalid='ignore') try: assert np.isnan(ncu.hypot(x, y)), "hypot(%s, %s) is %s, not nan" % (x, y, ncu.hypot(x, y)) finally: np.seterr(**err)
def assert_hypot_isinf(x, y): with np.errstate(invalid='ignore'): assert_(np.isinf(ncu.hypot(x, y)), "hypot(%s, %s) is %s, not inf" % (x, y, ncu.hypot(x, y)))
def assert_hypot_isnan(x, y): assert np.isnan(ncu.hypot(x, y)), "hypot(%s, %s) is %s, not nan" % (x, y, ncu.hypot(x, y))
def assert_hypot_isinf(x, y): assert np.isinf(ncu.hypot(x, y)), "hypot(%s, %s) is %s, not inf" % (x, y, ncu.hypot(x, y))
def assert_hypot_isnan(x, y): assert np.isnan(ncu.hypot(x, y))
def assert_hypot_isinf(x, y): assert np.isinf(ncu.hypot(x, y))
def test_simple(self): assert_almost_equal(ncu.hypot(1, 1), ncu.sqrt(2)) assert_almost_equal(ncu.hypot(0, 0), 0)
def assert_hypot_isnan(x, y): assert np.isnan(ncu.hypot( x, y)), "hypot(%s, %s) is %s, not nan" % (x, y, ncu.hypot(x, y))
def assert_hypot_isinf(x, y): err = np.seterr(invalid='ignore') try: assert np.isinf(ncu.hypot(x, y)), "hypot(%s, %s) is %s, not inf" % (x, y, ncu.hypot(x, y)) finally: np.seterr(**err)
def assert_hypot_isinf(x, y): assert np.isinf(ncu.hypot( x, y)), "hypot(%s, %s) is %s, not inf" % (x, y, ncu.hypot(x, y))
def assert_hypot_isnan(x, y): with np.errstate(invalid="ignore"): assert_(np.isnan(ncu.hypot(x, y)), "hypot(%s, %s) is %s, not nan" % (x, y, ncu.hypot(x, y)))
def assert_hypot_isinf(x, y): err = np.seterr(invalid="ignore") try: assert_(np.isinf(ncu.hypot(x, y)), "hypot(%s, %s) is %s, not inf" % (x, y, ncu.hypot(x, y))) finally: np.seterr(**err)
def assert_hypot_isnan(x, y): err = np.seterr(invalid='ignore') try: assert_(np.isnan(ncu.hypot(x, y)), "hypot(%s, %s) is %s, not nan" % (x, y, ncu.hypot(x, y))) finally: np.seterr(**err)