Exemple #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)
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)))
Exemple #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))
Exemple #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))
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))
Exemple #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))
def assert_hypot_isinf(x, y):
    assert np.isinf(ncu.hypot(x, y))
Exemple #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)
def assert_hypot_isnan(x, y):
    assert np.isnan(ncu.hypot(x, y))
Exemple #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))
Exemple #14
0
 def test_simple(self):
     assert_almost_equal(ncu.hypot(1, 1), ncu.sqrt(2))
     assert_almost_equal(ncu.hypot(0, 0), 0)
Exemple #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)))
Exemple #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)
Exemple #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)