From 71a76c30ee29360b2cf964a84e5d81a7036bb902 Mon Sep 17 00:00:00 2001 From: smomapz <70259541+smomapz@users.noreply.github.com> Date: Thu, 31 Mar 2022 07:39:52 +0200 Subject: [PATCH 1/3] Update setup.py --- setup.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 8c9cebe..72be240 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name = "tps", - version = "0.2", + version = "0.3", description='Thin plate spline transformation', author = "Oliver Tonnhofer", author_email = "olt@omniscale.de", @@ -15,9 +15,11 @@ "Operating System :: OS Independent", "Programming Language :: C", "Programming Language :: C++", - "Programming Language :: Python :: 2.5", - "Programming Language :: Python :: 2.6", - "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Topic :: Scientific/Engineering", ], test_suite = 'tps.test.test_suite', From 3c801fad28aee36c560b94c1ca234718bfd980dc Mon Sep 17 00:00:00 2001 From: smomapz <70259541+smomapz@users.noreply.github.com> Date: Thu, 31 Mar 2022 07:40:50 +0200 Subject: [PATCH 2/3] Realtive import in Python3 --- tps/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tps/__init__.py b/tps/__init__.py index cf14886..4bf842c 100644 --- a/tps/__init__.py +++ b/tps/__init__.py @@ -18,6 +18,6 @@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. -from _tps import TPS, TPSError, from_control_points +from ._tps import TPS, TPSError, from_control_points -__all__ = ['TPS', 'TPSError', 'from_control_points'] \ No newline at end of file +__all__ = ['TPS', 'TPSError', 'from_control_points'] From caca0f91eb8cc468f81ce2999a2f39edeb85cda9 Mon Sep 17 00:00:00 2001 From: smomapz <70259541+smomapz@users.noreply.github.com> Date: Thu, 31 Mar 2022 07:41:59 +0200 Subject: [PATCH 3/3] Use new equal methods --- tps/test/test_tps.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tps/test/test_tps.py b/tps/test/test_tps.py index fe89d84..9ad9fbf 100644 --- a/tps/test/test_tps.py +++ b/tps/test/test_tps.py @@ -25,17 +25,17 @@ class TestTPS(unittest.TestCase): def test_init_from_list(self): t = TPS([(0, 0, 50, 50), (10, 10, 100, 100)]) - self.assertEquals(t.transform(4, 5), (72.5, 72.5)) + self.assertEqual(t.transform(4, 5), (72.5, 72.5)) t.add(0, 10, 70, 100) - self.assertEquals(t.transform(4, 5), (72.0, 75.0)) + self.assertEqual(t.transform(4, 5), (72.0, 75.0)) def test_simple(self): t = TPS() t.add(0, 0, 50, 50) t.add(10, 10, 100, 100) - self.assertEquals(t.transform(4, 5), (72.5, 72.5)) + self.assertEqual(t.transform(4, 5), (72.5, 72.5)) t.add(0, 10, 70, 100) - self.assertEquals(t.transform(4, 5), (72.0, 75.0)) + self.assertEqual(t.transform(4, 5), (72.0, 75.0)) def test_no_points(self): try: @@ -62,11 +62,11 @@ def test_from_control_points_list_backwards(self): backwards=True) results = t.transform(72, 75) - self.assertAlmostEquals(results[0], 4.0) - self.assertAlmostEquals(results[1], 5.0) + self.assertAlmostEqual(results[0], 4.0) + self.assertAlmostEqual(results[1], 5.0) def test_suite(): return unittest.TestLoader().loadTestsFromTestCase(TestTPS) if __name__ == '__main__': - unittest.main() \ No newline at end of file + unittest.main()