本文整理汇总了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)
示例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
示例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
示例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
示例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)
示例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
#------------------------------------------------------------------------------