module documentation

Miscellaneous functions for testing masked arrays and subclasses

Author
Pierre Gerard-Marchant
Unknown Field: contact
pierregm_at_uga_dot_edu
Unknown Field: version
$Id: testutils.py 3529 2007-11-13 08:01:14Z jarrod.millman $
Function almost Returns True if a and b are equal up to decimal places.
Function approx Returns true if all components of a and b are equal to given tolerances.
Function assert_almost_equal Asserts that two items are almost equal.
Function assert_array_almost_equal Checks the equality of two masked arrays, up to given number odecimals.
Function assert_array_approx_equal Checks the equality of two masked arrays, up to given number odecimals.
Function assert_array_compare Asserts that comparison between two masked arrays is satisfied.
Function assert_array_equal Checks the elementwise equality of two masked arrays.
Function assert_array_less Checks that x is smaller than y elementwise.
Function assert_equal Asserts that two items are equal.
Function assert_equal_records Asserts that two records are equal.
Function assert_mask_equal Asserts the equality of two masks.
Function fail_if_array_equal Raises an assertion error if two masked arrays are not equal elementwise.
Function fail_if_equal Raises an assertion error if two items are equal.
Function _assert_equal_on_sequences Asserts the equality of two non-array sequences.
Variable __all__masked Undocumented
Variable __some__from_testing Undocumented
def almost(a, b, decimal=6, fill_value=True): (source)

Returns True if a and b are equal up to decimal places.

If fill_value is True, masked values considered equal. Otherwise, masked values are considered unequal.

def approx(a, b, fill_value=True, rtol=1e-05, atol=1e-08): (source)

Returns true if all components of a and b are equal to given tolerances.

If fill_value is True, masked values considered equal. Otherwise, masked values are considered unequal. The relative error rtol should be positive and << 1.0 The absolute error atol comes into play for those elements of b that are very small or zero; it says how small a must be also.

def assert_almost_equal(actual, desired, decimal=7, err_msg='', verbose=True): (source)

Asserts that two items are almost equal.

The test is equivalent to abs(desired-actual) < 0.5 * 10**(-decimal).

def assert_array_almost_equal(x, y, decimal=6, err_msg='', verbose=True): (source)

Checks the equality of two masked arrays, up to given number odecimals.

The equality is checked elementwise.

def assert_array_approx_equal(x, y, decimal=6, err_msg='', verbose=True): (source)

Checks the equality of two masked arrays, up to given number odecimals.

The equality is checked elementwise.

def assert_array_compare(comparison, x, y, err_msg='', verbose=True, header='', fill_value=True): (source)

Asserts that comparison between two masked arrays is satisfied.

The comparison is elementwise.

def assert_array_equal(x, y, err_msg='', verbose=True): (source)

Checks the elementwise equality of two masked arrays.

def assert_array_less(x, y, err_msg='', verbose=True): (source)

Checks that x is smaller than y elementwise.

def assert_equal(actual, desired, err_msg=''): (source)

Asserts that two items are equal.

def assert_equal_records(a, b): (source)

Asserts that two records are equal.

Pretty crude for now.

def assert_mask_equal(m1, m2, err_msg=''): (source)

Asserts the equality of two masks.

def fail_if_array_equal(x, y, err_msg='', verbose=True): (source)

Raises an assertion error if two masked arrays are not equal elementwise.

def fail_if_equal(actual, desired, err_msg=''): (source)

Raises an assertion error if two items are equal.

def _assert_equal_on_sequences(actual, desired, err_msg=''): (source)

Asserts the equality of two non-array sequences.

__all__masked: list[str] = (source)

Undocumented

__some__from_testing: list[str] = (source)

Undocumented