Пример #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)