skneuromsi.testing module
Public testing utility functions.
This module exposes “assert” functions which facilitate the comparison in a testing environment of objects created in “scikit-neuromsi”.
The functionalities are extensions of those present in “xarray.testing” and “numpy.testing”.
- skneuromsi.testing.assert_ndresult_allclose(left, right, rtol=1e-05, atol=1e-08, equal_nan=True, decode_bytes=True)[source]
Assert that two NDResult objects are approximately equal.
- Parameters:
left (NDResult) – The first NDResult object to compare.
right (NDResult) – The second NDResult object to compare.
rtol (float, optional) – The relative tolerance parameter for the assert_allclose function (default is 1e-05).
atol (float, optional) – The absolute tolerance parameter for the assert_allclose function (default is 1e-08).
equal_nan (bool, optional) – Whether to compare NaN values in the arrays (default is True).
decode_bytes (bool, optional) – Whether to decode bytes in the arrays (default is True). (See xarray.testing.assert_allclose for details).
- skneuromsi.testing.assert_ndresult_collection_allclose(left, right, rtol=1e-05, atol=1e-08, equal_nan=True, decode_bytes=True)[source]
Assert that two NDResultCollection objects are approximately equal.
- Parameters:
left (NDResultCollection) – The first NDResultCollection object to compare.
right (NDResultCollection) – The second NDResultCollection object to compare.
rtol (float, optional) – The relative tolerance parameter for the assert_allclose function (default is 1e-05).
atol (float, optional) – The absolute tolerance parameter for the assert_allclose function (default is 1e-08).
equal_nan (bool, optional) – Whether to compare NaN values in the arrays (default is True).
decode_bytes (bool, optional) – Whether to decode bytes in the arrays (default is True). (See xarray.testing.assert_allclose for details).