Beispiel #1
0
 def test_transformation_interval(self, points, params):
     manual_transformation = RotationZX()
     auto_transformation = Composition(RotationZ(), RotationX())
     self.assertSound(manual_transformation.transform(points, params),
                      params,
                      partial(manual_transformation.transform, points))
     self.assertSound(auto_transformation.transform(points, params), params,
                      partial(auto_transformation.transform, points))
Beispiel #2
0
 def test_taylor_approximation(self, x, params):
     manual_transformation = RotationZX()
     auto_transformation = Composition(RotationZ(), RotationX())
     manual = taylor.encode(manual_transformation, x, params)
     auto = taylor.encode(auto_transformation, x, params)
     self.assertSound(manual, params,
                      partial(manual_transformation.transform, x))
     self.assertSound(auto, params, partial(auto_transformation.transform,
                                            x))
Beispiel #3
0
 def test_hessian_points_params_float(self, points, params):
     expected = RotationZX().hessian_points_params(points, params)
     actual = Composition(RotationZ(), RotationX()).hessian_points_params(
         points, params)
     self.assertAlmostEqualList(expected, actual)
Beispiel #4
0
 def test_transformation_float(self, points, params):
     manual_transformation = RotationZX()
     auto_transformation = Composition(RotationZ(), RotationX())
     expected = manual_transformation.transform(points, params)
     actual = auto_transformation.transform(points, params)
     self.assertAlmostEqualNumpy(expected, actual)