HiggsAnalysis-KITHiggsToTauTau
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
uncertainties.test_uncertainties Namespace Reference

Classes

class  DerivativesDiffer
 
class  NewVariable_dict
 Classes for the pickling tests (put at the module level, so that they can be unpickled): More...
 
class  NewVariable_slots_tuple
 
class  NewVariable_slots_str
 
class  FunctionCalled
 Test of the unicode formatting of numbers with uncertainties. More...
 

Functions

def numbers_close
 Returns True if the given floats are close enough. More...
 
def ufloats_close
 
def compare_derivatives
 
def test_value_construction
 
def test_ufloat_fromstr
 Pre-calculated derivatives for operations on AffineScalarFunc. More...
 
def test_fixed_derivatives_basic_funcs
 Takes two Variable objects. More...
 
def test_copy
 
def test_pickling
 
def test_int_div
 
def test_comparison_ops
 
def test_logic
 
def test_obsolete
 
def test_basic_access_to_data
 
def test_correlations
 
def test_no_coercion
 
def test_wrapped_func_no_args_no_kwargs
 
def test_wrapped_func_args_no_kwargs
 Checks special cases of the built-in pow() power operator. More...
 
def test_wrapped_func_no_args_kwargs
 
def test_wrapped_func_args_kwargs
 
def test_wrapped_func
 
def test_wrap_with_kwargs
 
def failing_func
 
def test_access_to_std_dev
 Tests the input of correlated value. More...
 
def test_covariances
 
def test_power_all_cases
 
def power_all_cases
 
def test_power_special_cases
 
def power_special_cases
 
def test_power_wrt_ref
 
def power_wrt_ref
 
def test_PDG_precision
 
def test_repr
 
def test_format
 
def test_unicode_format
 
def arrays_close
 
def test_numpy_comparison
 
def test_correlated_values
 
def test_correlated_values_correlation_mat
 

Variables

tuple x = ufloat(1, 0.1)
 Test the formatting of numbers with uncertainty. More...
 
tuple y = ufloat(10, 0.11)
 
tuple z = ufloat(100, 0.111)
 
tuple t = ufloat(0.1, 0.1111)
 
tuple f_wrapped2
 
tuple f_wrapped3
 
tuple f_wrapped4
 

Function Documentation

def uncertainties.test_uncertainties.arrays_close (   m1,
  m2,
  precision = 1e-4 
)
def uncertainties.test_uncertainties.compare_derivatives (   func,
  numerical_derivatives,
  num_args_list = None 
)
def uncertainties.test_uncertainties.failing_func (   x,
  y,
  args,
  kwargs 
)
def uncertainties.test_uncertainties.numbers_close (   x,
  y,
  tolerance = 1e-6 
)

Returns True if the given floats are close enough.

The given tolerance is the relative difference allowed, or the absolute difference, if one of the numbers is 0.

NaN is allowed: it is considered close to itself.

def uncertainties.test_uncertainties.power_all_cases (   op)
def uncertainties.test_uncertainties.power_special_cases (   op)
def uncertainties.test_uncertainties.power_wrt_ref (   op,
  ref_op 
)
def uncertainties.test_uncertainties.test_access_to_std_dev ( )

Tests the input of correlated value.

Test through their correlation matrix (instead of the covariance matrix).

def uncertainties.test_uncertainties.test_basic_access_to_data ( )
def uncertainties.test_uncertainties.test_comparison_ops ( )
def uncertainties.test_uncertainties.test_copy ( )
def uncertainties.test_uncertainties.test_correlated_values ( )
def uncertainties.test_uncertainties.test_correlated_values_correlation_mat ( )
def uncertainties.test_uncertainties.test_correlations ( )
def uncertainties.test_uncertainties.test_covariances ( )
def uncertainties.test_uncertainties.test_fixed_derivatives_basic_funcs ( )

Takes two Variable objects.

Fails if any comparison operation fails to follow the proper semantics a comparison only returns True if the correspond float comparison results are True for all the float values taken by the variables (of x and y) when they vary in an infinitesimal neighborhood within their uncertainty.

This test is stochastic: it may, exceptionally, fail for correctly implemented comparison operators.

def uncertainties.test_uncertainties.test_format ( )
def uncertainties.test_uncertainties.test_int_div ( )
def uncertainties.test_uncertainties.test_logic ( )
def uncertainties.test_uncertainties.test_no_coercion ( )
def uncertainties.test_uncertainties.test_numpy_comparison ( )
def uncertainties.test_uncertainties.test_obsolete ( )
def uncertainties.test_uncertainties.test_PDG_precision ( )
def uncertainties.test_uncertainties.test_pickling ( )
def uncertainties.test_uncertainties.test_power_all_cases ( )
def uncertainties.test_uncertainties.test_power_special_cases ( )
def uncertainties.test_uncertainties.test_power_wrt_ref ( )
def uncertainties.test_uncertainties.test_repr ( )
def uncertainties.test_uncertainties.test_ufloat_fromstr ( )

Pre-calculated derivatives for operations on AffineScalarFunc.

def uncertainties.test_uncertainties.test_unicode_format ( )
def uncertainties.test_uncertainties.test_value_construction ( )
def uncertainties.test_uncertainties.test_wrap_with_kwargs ( )
def uncertainties.test_uncertainties.test_wrapped_func ( )
def uncertainties.test_uncertainties.test_wrapped_func_args_kwargs ( )
def uncertainties.test_uncertainties.test_wrapped_func_args_no_kwargs ( )

Checks special cases of the built-in pow() power operator.

def uncertainties.test_uncertainties.test_wrapped_func_no_args_kwargs ( )
def uncertainties.test_uncertainties.test_wrapped_func_no_args_no_kwargs ( )
def uncertainties.test_uncertainties.ufloats_close (   x,
  y,
  tolerance = 1e-6 
)

Variable Documentation

tuple uncertainties.test_uncertainties.f_wrapped2
Initial value:
1 = uncert_core.wrap(
2  f, [None, lambda x, y, *args, **kwargs: math.cos(y)])
tuple uncertainties.test_uncertainties.f_wrapped3
Initial value:
1 = uncert_core.wrap(
2  f,
3  [None, None, lambda x, y, *args, **kwargs: 2],
4  {'t': lambda x, y, *args, **kwargs: 3})
tuple uncertainties.test_uncertainties.f_wrapped4
Initial value:
1 = uncert_core.wrap(
2  f,
3  # Correlated variables.
4  # Test through the input of the (full) covariance matrix.
5  #
6 
7  [None, failing_func],
8  {'t': failing_func})
tuple uncertainties.test_uncertainties.t = ufloat(0.1, 0.1111)
tuple uncertainties.test_uncertainties.x = ufloat(1, 0.1)

Test the formatting of numbers with uncertainty.

tuple uncertainties.test_uncertainties.y = ufloat(10, 0.11)
tuple uncertainties.test_uncertainties.z = ufloat(100, 0.111)