From 2920116b542e35cf58a833af88010c70e06c1e91 Mon Sep 17 00:00:00 2001 From: Paul McCarthy <pauldmccarthy@gmail.com> Date: Thu, 8 Oct 2020 14:19:13 +0100 Subject: [PATCH] TEST: Add test case with shear component --- tests/test_transform/test_affine.py | 5 +++-- .../testdata/test_transform_test_compose.txt | 15 ++++++++++----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/tests/test_transform/test_affine.py b/tests/test_transform/test_affine.py index 79a17fba6..f17ad4e7a 100644 --- a/tests/test_transform/test_affine.py +++ b/tests/test_transform/test_affine.py @@ -226,8 +226,9 @@ def test_compose_and_decompose(): xform = lines[i * 4: i * 4 + 4] xform = np.genfromtxt(xform) - scales, offsets, rotations = affine.decompose(xform) - result = affine.compose(scales, offsets, rotations) + scales, offsets, rotations, shears = affine.decompose( + xform, shears=True) + result = affine.compose(scales, offsets, rotations, shears=shears) assert np.all(np.isclose(xform, result, atol=1e-5)) diff --git a/tests/test_transform/testdata/test_transform_test_compose.txt b/tests/test_transform/testdata/test_transform_test_compose.txt index e61f31bdd..497fba860 100644 --- a/tests/test_transform/testdata/test_transform_test_compose.txt +++ b/tests/test_transform/testdata/test_transform_test_compose.txt @@ -23,7 +23,7 @@ 1.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 -1.0 0.0 -0.0 0.0 0.0 1.0 +0.0 0.0 0.0 1.0 0.5 0.0 0.0 0.0 0.0 2.4 0.0 0.0 @@ -35,22 +35,22 @@ 0.0 0.0 1.6 53.0 0.0 0.0 0.0 1.0 -0.5 0.0 0.0 10.0 +0.5 0.0 0.0 10.0 0.0 0.0 -1.6 -6.7877502441 0.0 2.4 0.0 29.7931518555 -0.0 0.0 0.0 1.0 +0.0 0.0 0.0 1.0 0.0 -2.4 -0.0 30.6160888672 0.0 0.0 -1.6 -6.7877502441 0.5 0.0 0.0 50.5961608887 -0.0 0.0 0.0 1.0 +0.0 0.0 0.0 1.0 -0.0 1.3765834472 1.3106432709 0.0736983719 0.0 -1.9659649063 0.9177222982 14.1062102814 0.5 0.0 0.0 50.5961608887 0.0 0.0 0.0 1.0 - 0.453766452 -0.7004337463 0.4832135801 16.789591468 + 0.453766452 -0.7004337463 0.4832135801 16.789591468 -0.0159784155 1.6056689296 1.1880787388 -16.2943532298 -0.2093817023 -1.640493784 0.9565424959 66.1123321137 0.0 0.0 0.0 1.0 @@ -109,3 +109,8 @@ 0.041017 -0.081580 -6.319922 72.090378 -0.000000 0.381914 -1.365036 -41.159451 0.000000 0.000000 0.000000 1.000000 + +1.1441229 0.833406 3.765340 3 +0.8312539 2.459607 -0.804545 4 +1.4142136 1.554275 1.724796 5 +0.0 0.0 0.0 1 -- GitLab