2 GTSAM Copyright 2010-2019, Georgia Tech Research Corporation,
3 Atlanta, Georgia 30332-0415
6 See LICENSE for the license information
8 TestCase class with GTSAM assert utils.
13 from copy
import deepcopy
17 """TestCase class with GTSAM assert utils."""
20 """ AssertEqual function that prints out actual and expected if not equal.
22 self.gtsamAssertEqual(actual,expected)
24 tol {float} -- tolerance passed to 'equals', default 1e-9
28 equal = numpy.allclose(actual, expected, atol=tol)
30 equal = actual.equals(expected, tol)
32 raise self.failureException(
"Values are not equal:\n{}!={}".
format(
36 """ Performs a round-trip using pickle and asserts equality.
39 self.assertEqualityOnPickleRoundtrip(obj)
41 tol {float} -- tolerance passed to 'equals', default 1e-9
43 roundTripObj = pickle.loads(pickle.dumps(obj))
47 """Perform assertion by checking if a
48 deep copied version of `obj` is equal to itself.
51 obj: The object to check is deep-copyable.