You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
meanas/meanas/test/utils.py

14 lines
462 B
Python

import numpy # type: ignore
PRNG = numpy.random.RandomState(12345)
def assert_fields_close(x, y, *args, **kwargs):
numpy.testing.assert_allclose(
x, y, verbose=False,
err_msg='Fields did not match:\n{}\n{}'.format(numpy.rollaxis(x, -1),
numpy.rollaxis(y, -1)), *args, **kwargs)
def assert_close(x, y, *args, **kwargs):
numpy.testing.assert_allclose(x, y, *args, **kwargs)