From 3bf2a70475a8b4e6d53abef4427f3e167586bb4c Mon Sep 17 00:00:00 2001
From: jack-parsons <jack.parsons.uk@icloud.com>
Date: Wed, 24 Jul 2019 18:00:08 +0100
Subject: [PATCH] Cleaning up example code

temporarily reverted to using manual tests while pytest is not installed
---
 .gitlab-ci.yml                            | 16 ++++++---
 AmpScan/align.py                          | 41 ++++++++++-------------
 tests/pca_tests/sample_stl_sphere_BIN.stl |  2 +-
 3 files changed, 30 insertions(+), 29 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e180118..f787277 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 6327e4c..12e8125 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 de40fb5..c9d4e3e 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
-- 
GitLab