diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e18011842b96d37151ae988ea793273666a8a309..f78727798a9d3733c82fee74f1b08e7380a1ee70 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,12 @@ -doctests and unitests: - script: conda install pytest - y - pytest --doctest-modules -v --ignore=GUIs \ No newline at end of file +#doctests and unitests: +# script: pytest --doctest-modules -v --ignore=GUIs + +# Temporarily added back old testing +unittests: + script: python -m unittest discover tests -v +core doctests: + script: python -m doctest -v AmpScan/core.py +registration doctests: + script: python -m doctest -v AmpScan/registration.py +align doctests: + script: python -m doctest -v AmpScan/align.py diff --git a/AmpScan/align.py b/AmpScan/align.py index 6327e4cf3bf76458c5e1c5cbc22c66ba159af299..12e8125b619af2fd7af3e28bbff00c5028614703 100644 --- a/AmpScan/align.py +++ b/AmpScan/align.py @@ -13,6 +13,11 @@ from scipy.optimize import minimize from AmpScan.core import AmpObject from AmpScan.ampVis import vtkRenWin +# For doc examples +import os +staticfh = os.getcwd() + "\\tests\\stl_file.stl" +movingfh = os.getcwd() + "\\tests\\stl_file_2.stl" + class align(object): r""" @@ -41,12 +46,9 @@ class align(object): Examples -------- - >>> import AmpScan, os - >>> staticfh = os.getcwd()+"\\tests\\stl_file.stl" - >>> movingfh = os.getcwd()+"\\tests\\stl_file_2.stl" - >>> static = AmpScan.AmpObject(staticfh) - >>> moving = AmpScan.AmpObject(movingfh) - >>> al = AmpScan.align(moving, static).m + >>> static = AmpObject(staticfh) + >>> moving = AmpObject(movingfh) + >>> al = align(moving, static).m """ @@ -179,12 +181,9 @@ class align(object): Examples -------- - >>> import AmpScan, os - >>> staticfh = os.getcwd()+"\\tests\\stl_file.stl" - >>> movingfh = os.getcwd()+"\\tests\\stl_file_2.stl" - >>> static = AmpScan.AmpObject(staticfh) - >>> moving = AmpScan.AmpObject(movingfh) - >>> al = AmpScan.align(moving, static, method='linPoint2Plane').m + >>> static = AmpObject(staticfh) + >>> moving = AmpObject(movingfh) + >>> al = align(moving, static, method='linPoint2Plane').m """ cn = np.c_[np.cross(mv, sn), sn] @@ -235,12 +234,9 @@ class align(object): Examples -------- - >>> import AmpScan, os - >>> staticfh = os.getcwd()+"\\tests\\stl_file.stl" - >>> movingfh = os.getcwd()+"\\tests\\stl_file_2.stl" - >>> static = AmpScan.AmpObject(staticfh) - >>> moving = AmpScan.AmpObject(movingfh) - >>> al = AmpScan.align(moving, static, method='linPoint2Point').m + >>> static = AmpObject(staticfh) + >>> moving = AmpObject(movingfh) + >>> al = align(moving, static, method='linPoint2Point').m """ mCent = mv - mv.mean(axis=0) @@ -280,12 +276,9 @@ class align(object): Examples -------- - >>> import os, AmpScan - >>> staticfh = os.getcwd()+"\\tests\\stl_file.stl" - >>> movingfh = os.getcwd()+"\\tests\\stl_file_2.stl" - >>> static = AmpScan.AmpObject(staticfh) - >>> moving = AmpScan.AmpObject(movingfh) - >>> al = AmpScan.align(moving, static, method='optPoint2Point', opt='SLSQP').m + >>> static = AmpObject(staticfh) + >>> moving = AmpObject(movingfh) + >>> al = align(moving, static, method='optPoint2Point', opt='SLSQP').m """ X = np.zeros(6) diff --git a/tests/pca_tests/sample_stl_sphere_BIN.stl b/tests/pca_tests/sample_stl_sphere_BIN.stl index de40fb579910b12e4b6577fe1a171e6b574de3c5..c9d4e3eeafa54a49e54f86b6b48e06bdcf77fec1 100644 --- a/tests/pca_tests/sample_stl_sphere_BIN.stl +++ b/tests/pca_tests/sample_stl_sphere_BIN.stl @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1f92d690baf69fd2dc5817c90ee85c5ffb9b36dc627521dc6be136c6c7fd4de6 +oid sha256:23d4d80f3205706d0d53df58f592c99abcc0558a9c82cd59a89f43126b3e8313 size 64084