special._testutils

Module Contents

Classes

MissingModule(self,name)
FuncData(self,func,data,param_columns,result_columns=None,result_func=None,rtol=None,atol=None,param_filter=None,knownfailure=None,dataname=None,nan_ok=False,vectorized=True,ignore_inf_sign=False,distinguish_nan_and_inf=True) Data set for checking a special function.

Functions

check_version(module,min_ver)
with_special_errors(func) Enable special function errors (such as underflow, overflow,
assert_tol_equal(a,b,rtol=1e-07,atol=0,err_msg=”“,verbose=True) Assert that a and b are equal to tolerance atol + rtol*abs(b)
assert_func_equal(func,results,points,rtol=None,atol=None,param_filter=None,knownfailure=None,vectorized=True,dtype=None,nan_ok=False,ignore_inf_sign=False,distinguish_nan_and_inf=True)
class MissingModule(name)
__init__(name)
check_version(module, min_ver)
with_special_errors(func)

Enable special function errors (such as underflow, overflow, loss of precision, etc.)

assert_tol_equal(a, b, rtol=1e-07, atol=0, err_msg="", verbose=True)

Assert that a and b are equal to tolerance atol + rtol*abs(b)

assert_func_equal(func, results, points, rtol=None, atol=None, param_filter=None, knownfailure=None, vectorized=True, dtype=None, nan_ok=False, ignore_inf_sign=False, distinguish_nan_and_inf=True)
class FuncData(func, data, param_columns, result_columns=None, result_func=None, rtol=None, atol=None, param_filter=None, knownfailure=None, dataname=None, nan_ok=False, vectorized=True, ignore_inf_sign=False, distinguish_nan_and_inf=True)

Data set for checking a special function.

func : function
Function to test
filename : str
Input file name
param_columns : int or tuple of ints
Columns indices in which the parameters to func lie. Can be imaginary integers to indicate that the parameter should be cast to complex.
result_columns : int or tuple of ints, optional
Column indices for expected results from func.
result_func : callable, optional
Function to call to obtain results.
rtol : float, optional
Required relative tolerance. Default is 5*eps.
atol : float, optional
Required absolute tolerance. Default is 5*tiny.
param_filter : function, or tuple of functions/Nones, optional
Filter functions to exclude some parameter ranges. If omitted, no filtering is done.
knownfailure : str, optional
Known failure error message to raise when the test is run. If omitted, no exception is raised.
nan_ok : bool, optional
If nan is always an accepted result.
vectorized : bool, optional
Whether all functions passed in are vectorized.
ignore_inf_sign : bool, optional
Whether to ignore signs of infinities. (Doesn’t matter for complex-valued functions.)
distinguish_nan_and_inf : bool, optional
If True, treat numbers which contain nans or infs as as equal. Sets ignore_inf_sign to be True.
__init__(func, data, param_columns, result_columns=None, result_func=None, rtol=None, atol=None, param_filter=None, knownfailure=None, dataname=None, nan_ok=False, vectorized=True, ignore_inf_sign=False, distinguish_nan_and_inf=True)
get_tolerances(dtype)
check(data=None, dtype=None)

Check the special function against the data.

__repr__()

Pretty-printing, esp. for Nose output