Skip to content
Snippets Groups Projects
Commit 3bf2a704 authored by jack-parsons's avatar jack-parsons
Browse files

Cleaning up example code

temporarily reverted to using manual tests while pytest is not installed
parent 5c595582
Branches
No related tags found
1 merge request!23Merge in Jack's changes
Pipeline #871 passed
doctests and unitests: #doctests and unitests:
script: conda install pytest # script: pytest --doctest-modules -v --ignore=GUIs
y
pytest --doctest-modules -v --ignore=GUIs # Temporarily added back old testing
\ No newline at end of file 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
...@@ -13,6 +13,11 @@ from scipy.optimize import minimize ...@@ -13,6 +13,11 @@ from scipy.optimize import minimize
from AmpScan.core import AmpObject from AmpScan.core import AmpObject
from AmpScan.ampVis import vtkRenWin 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): class align(object):
r""" r"""
...@@ -41,12 +46,9 @@ class align(object): ...@@ -41,12 +46,9 @@ class align(object):
Examples Examples
-------- --------
>>> import AmpScan, os >>> static = AmpObject(staticfh)
>>> staticfh = os.getcwd()+"\\tests\\stl_file.stl" >>> moving = AmpObject(movingfh)
>>> movingfh = os.getcwd()+"\\tests\\stl_file_2.stl" >>> al = align(moving, static).m
>>> static = AmpScan.AmpObject(staticfh)
>>> moving = AmpScan.AmpObject(movingfh)
>>> al = AmpScan.align(moving, static).m
""" """
...@@ -179,12 +181,9 @@ class align(object): ...@@ -179,12 +181,9 @@ class align(object):
Examples Examples
-------- --------
>>> import AmpScan, os >>> static = AmpObject(staticfh)
>>> staticfh = os.getcwd()+"\\tests\\stl_file.stl" >>> moving = AmpObject(movingfh)
>>> movingfh = os.getcwd()+"\\tests\\stl_file_2.stl" >>> al = align(moving, static, method='linPoint2Plane').m
>>> static = AmpScan.AmpObject(staticfh)
>>> moving = AmpScan.AmpObject(movingfh)
>>> al = AmpScan.align(moving, static, method='linPoint2Plane').m
""" """
cn = np.c_[np.cross(mv, sn), sn] cn = np.c_[np.cross(mv, sn), sn]
...@@ -235,12 +234,9 @@ class align(object): ...@@ -235,12 +234,9 @@ class align(object):
Examples Examples
-------- --------
>>> import AmpScan, os >>> static = AmpObject(staticfh)
>>> staticfh = os.getcwd()+"\\tests\\stl_file.stl" >>> moving = AmpObject(movingfh)
>>> movingfh = os.getcwd()+"\\tests\\stl_file_2.stl" >>> al = align(moving, static, method='linPoint2Point').m
>>> static = AmpScan.AmpObject(staticfh)
>>> moving = AmpScan.AmpObject(movingfh)
>>> al = AmpScan.align(moving, static, method='linPoint2Point').m
""" """
mCent = mv - mv.mean(axis=0) mCent = mv - mv.mean(axis=0)
...@@ -280,12 +276,9 @@ class align(object): ...@@ -280,12 +276,9 @@ class align(object):
Examples Examples
-------- --------
>>> import os, AmpScan >>> static = AmpObject(staticfh)
>>> staticfh = os.getcwd()+"\\tests\\stl_file.stl" >>> moving = AmpObject(movingfh)
>>> movingfh = os.getcwd()+"\\tests\\stl_file_2.stl" >>> al = align(moving, static, method='optPoint2Point', opt='SLSQP').m
>>> static = AmpScan.AmpObject(staticfh)
>>> moving = AmpScan.AmpObject(movingfh)
>>> al = AmpScan.align(moving, static, method='optPoint2Point', opt='SLSQP').m
""" """
X = np.zeros(6) X = np.zeros(6)
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment