コード例 #1
0
ファイル: test_umath.py プロジェクト: 8cH9azbsFifZ/wspr
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
ファイル: test_umath.py プロジェクト: kidaa/Neuroimaging
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
ファイル: test_umath.py プロジェクト: kidaa/Neuroimaging
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)
コード例 #8
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
ファイル: test_umath.py プロジェクト: ogrisel/numpy
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)))
コード例 #13
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))
コード例 #14
0
ファイル: test_umath.py プロジェクト: jarrodmillman/numpy
 def test_simple(self):
     assert_almost_equal(ncu.hypot(1, 1), ncu.sqrt(2))
     assert_almost_equal(ncu.hypot(0, 0), 0)
コード例 #15
0
ファイル: test_umath.py プロジェクト: pombredanne/linuxtrail
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
ファイル: test_umath.py プロジェクト: jarrodmillman/numpy
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)