當前位置: 首頁>>代碼示例>>Python>>正文


Python dec.slow方法代碼示例

本文整理匯總了Python中numpy.testing.dec.slow方法的典型用法代碼示例。如果您正苦於以下問題:Python dec.slow方法的具體用法?Python dec.slow怎麽用?Python dec.slow使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在numpy.testing.dec的用法示例。


在下文中一共展示了dec.slow方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_safe_binop

# 需要導入模塊: from numpy.testing import dec [as 別名]
# 或者: from numpy.testing.dec import slow [as 別名]
def test_safe_binop():
    # Test checked arithmetic routines

    ops = [
        (operator.add, 1),
        (operator.sub, 2),
        (operator.mul, 3)
    ]

    with exc_iter(ops, INT64_VALUES, INT64_VALUES) as it:
        for xop, a, b in it:
            pyop, op = xop
            c = pyop(a, b)

            if not (INT64_MIN <= c <= INT64_MAX):
                assert_raises(OverflowError, mt.extint_safe_binop, a, b, op)
            else:
                d = mt.extint_safe_binop(a, b, op)
                if c != d:
                    # assert_equal is slow
                    assert_equal(d, c) 
開發者ID:birforce,項目名稱:vnpy_crypto,代碼行數:23,代碼來源:test_extint128.py

示例2: slow

# 需要導入模塊: from numpy.testing import dec [as 別名]
# 或者: from numpy.testing.dec import slow [as 別名]
def slow(t):
    """
    Label a test as 'slow'.

    The exact definition of a slow test is obviously both subjective and
    hardware-dependent, but in general any individual test that requires more
    than a second or two should be labeled as slow (the whole suite consists of
    thousands of tests, so even a second is significant).

    Parameters
    ----------
    t : callable
        The test to label as slow.

    Returns
    -------
    t : callable
        The decorated test `t`.

    Examples
    --------
    The `numpy.testing` module includes ``import decorators as dec``.
    A test can be decorated as slow like this::

      from numpy.testing import *

      @dec.slow
      def test_big(self):
          print('Big, slow test')

    """

    t.slow = True
    return t 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:36,代碼來源:decorators.py

示例3: slow

# 需要導入模塊: from numpy.testing import dec [as 別名]
# 或者: from numpy.testing.dec import slow [as 別名]
def slow(t):
    """
    Label a test as 'slow'.

    The exact definition of a slow test is obviously both subjective and
    hardware-dependent, but in general any individual test that requires more
    than a second or two should be labeled as slow (the whole suite consits of
    thousands of tests, so even a second is significant).

    Parameters
    ----------
    t : callable
        The test to label as slow.

    Returns
    -------
    t : callable
        The decorated test `t`.

    Examples
    --------
    The `numpy.testing` module includes ``import decorators as dec``.
    A test can be decorated as slow like this::

      from numpy.testing import *

      @dec.slow
      def test_big(self):
          print('Big, slow test')

    """

    t.slow = True
    return t 
開發者ID:birforce,項目名稱:vnpy_crypto,代碼行數:36,代碼來源:decorators.py

示例4: test_cont_fit

# 需要導入模塊: from numpy.testing import dec [as 別名]
# 或者: from numpy.testing.dec import slow [as 別名]
def test_cont_fit():
    # this tests the closeness of the estimated parameters to the true
    # parameters with fit method of continuous distributions
    # Note: is slow, some distributions don't converge with sample size <= 10000

    for distname, arg in distcont:
        if distname not in skip_fit:
            yield check_cont_fit, distname,arg 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:10,代碼來源:test_fit.py

示例5: nonfunctional_tooslow

# 需要導入模塊: from numpy.testing import dec [as 別名]
# 或者: from numpy.testing.dec import slow [as 別名]
def nonfunctional_tooslow(func):
    return dec.skipif(True, "    Test not yet functional (too slow), needs more work.")(func) 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:4,代碼來源:test_mpmath.py

示例6: __new__

# 需要導入模塊: from numpy.testing import dec [as 別名]
# 或者: from numpy.testing.dec import slow [as 別名]
def __new__(cls, cls_name, bases, dct):
        for name, item in list(dct.items()):
            if name.startswith('test_'):
                item = dec.slow(item)
                item = mpmath_check(cls.mpmath_min_version)(item)
                dct[name] = item
        return type.__new__(cls, cls_name, bases, dct)


#------------------------------------------------------------------------------
# Dealing with mpmath quirks
#------------------------------------------------------------------------------ 
開發者ID:ktraunmueller,項目名稱:Computable,代碼行數:14,代碼來源:test_mpmath.py


注:本文中的numpy.testing.dec.slow方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。