Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions tps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
__all__ = ['TPS', 'TPSError', 'from_control_points']
14 changes: 7 additions & 7 deletions tps/test/test_tps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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()
unittest.main()