当前位置: 首页>>代码示例>>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;未经允许,请勿转载。