π Geometric Computer Vision Library for Spatial AI
Python artificial-intelligencecomputer-visiondeep-learninghacktoberfestimage-processingmachine-learningneural-networkpythonpytorchroboticsspatial-ai
fix local tests
edgarriba2f1d583c63ec
diff --git a/.gitignore b/.gitignoreindex af4efcdde..12d3b0e59 100644--- a/.gitignore+++ b/.gitignore@@ -6,4 +6,7 @@ torchgeometry.egg-info/*/**/*~*~*.swp+.eggs/*+.cache/*+.pytest_cache/*docs/builddiff --git a/README.rst b/README.rstindex 715e6b1bd..3d3ae3e93 100644--- a/README.rst+++ b/README.rst@@ -12,6 +12,12 @@ From source:python setup.py install+Testing+=======++.. code:: bash++ python setup.py testContributing============diff --git a/setup.cfg b/setup.cfgnew file mode 100644index 000000000..b7e478982--- /dev/null+++ b/setup.cfg@@ -0,0 +1,2 @@+[aliases]+test=pytestdiff --git a/setup.py b/setup.pyindex b2b4749f6..bb1c13943 100644--- a/setup.py+++ b/setup.py@@ -43,6 +43,10 @@ setup(long_description=readme,license='BSD',+ # Test+ setup_requires=['pytest-runner'],+ tests_require=['pytest'],+# Package infopackages=find_packages(exclude=('test',)),diff --git a/test/test_functional.py b/test/test_functional.pyindex 30892ebaf..a49f748c5 100644--- a/test/test_functional.py+++ b/test/test_functional.py@@ -10,15 +10,16 @@ class Tester(unittest.TestCase):points = torch.rand(1, 2, 3)points_h = dgm.convert_points_to_homogeneous(points)- assert (points_h[..., -1] == torch.ones(1, 2, 1)).all()+ self.assertTrue((points_h[..., -1] == torch.ones(1, 2, 1)).all())def test_convert_points_from_homogeneous(self):points_h = torch.rand(1, 2, 3)points_h[..., -1] = 1.0points = dgm.convert_points_from_homogeneous(points_h)- assert (points_h[..., :2] == points[..., :2]).all()+ error = torch.sum((points_h[..., :2] - points) ** 2)+ self.assertAlmostEqual(error, 0.0)if __name__ == '__main__':unittest.main()