示例#1
0
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)
示例#2
0
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)))
示例#3
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))
示例#4
0
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))
示例#5
0
def assert_hypot_isnan(x, y):
    assert np.isnan(ncu.hypot(x, y))
示例#6
0
def assert_hypot_isinf(x, y):
    assert np.isinf(ncu.hypot(x, y))
示例#7
0
 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))
示例#9
0
def assert_hypot_isinf(x, y):
    assert np.isinf(ncu.hypot(x, y))
示例#10
0
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)
示例#11
0
def assert_hypot_isnan(x, y):
    assert np.isnan(ncu.hypot(x, y))
示例#12
0
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_isinf(x, y):
    assert np.isinf(ncu.hypot(
        x, y)), "hypot(%s, %s) is %s, not inf" % (x, y, ncu.hypot(x, y))
示例#14
0
 def test_simple(self):
     assert_almost_equal(ncu.hypot(1, 1), ncu.sqrt(2))
     assert_almost_equal(ncu.hypot(0, 0), 0)
示例#15
0
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)))
示例#16
0
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)
示例#17
0
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)