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 ​_assert​_equal​_on​_sequences Asserts the equality of two non-array sequences.
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.
Variable __all​_​_masked Undocumented
Variable __some​_​_from​_testing Undocumented
def _assert_equal_on_sequences(actual, desired, err_msg=''):
Asserts the equality of two non-array sequences.
def almost(a, b, decimal=6, fill_value=True):

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):

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):

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):

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):

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):

Asserts that comparison between two masked arrays is satisfied.

The comparison is elementwise.

def assert_array_equal(x, y, err_msg='', verbose=True):
Checks the elementwise equality of two masked arrays.
def assert_array_less(x, y, err_msg='', verbose=True):
Checks that x is smaller than y elementwise.
def assert_equal(actual, desired, err_msg=''):
Asserts that two items are equal.
def assert_equal_records(a, b):

Asserts that two records are equal.

Pretty crude for now.

def assert_mask_equal(m1, m2, err_msg=''):
Asserts the equality of two masks.
def fail_if_array_equal(x, y, err_msg='', verbose=True):
Raises an assertion error if two masked arrays are not equal elementwise.
def fail_if_equal(actual, desired, err_msg=''):
Raises an assertion error if two items are equal.
__all__masked: list[str] =

Undocumented

__some__from_testing: list[str] =

Undocumented