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

Cleaning up registration doctests and adding unittests for registration module

parent 098e1bae
No related branches found
No related tags found
1 merge request!23Merge in Jack's changes
Pipeline #874 passed
...@@ -9,6 +9,11 @@ from scipy import spatial ...@@ -9,6 +9,11 @@ from scipy import spatial
from AmpScan.core import AmpObject from AmpScan.core import AmpObject
import matplotlib.pyplot as plt import matplotlib.pyplot as plt
# For the doc examples
import os
basefh = os.getcwd()+"\\tests\\stl_file.stl"
targfh = os.getcwd()+"\\tests\\stl_file_2.stl"
class registration(object): class registration(object):
r""" r"""
Registration methods between two AmpObject meshes. This function morphs the baseline Registration methods between two AmpObject meshes. This function morphs the baseline
...@@ -36,13 +41,10 @@ class registration(object): ...@@ -36,13 +41,10 @@ class registration(object):
Examples Examples
-------- --------
>>> import os >>> from AmpScan.core import AmpObject
>>> import AmpScan >>> baseline = AmpObject(basefh)
>>> basefh = os.getcwd()+"\\tests\\stl_file.stl" >>> target = AmpObject(targfh)
>>> targfh = os.getcwd()+"\\tests\\stl_file_2.stl" >>> reg = registration(baseline, target, steps=10, neigh=10, smooth=1).reg
>>> baseline = AmpScan.AmpObject(basefh)
>>> target = AmpScan.AmpObject(targfh)
>>> reg = AmpScan.registration(baseline, target, steps=10, neigh=10, smooth=1).reg
""" """
def __init__(self, baseline, target, method='point2plane', *args, **kwargs): def __init__(self, baseline, target, method='point2plane', *args, **kwargs):
......
"""
Testing suite for the core module
"""
import unittest
import os
import numpy as np
from random import randrange
class TestCore(unittest.TestCase):
ACCURACY = 5 # The number of decimal places to value accuracy for - needed due to floating point inaccuracies
def setUp(self):
"""Runs before each unit test.
Sets up the AmpObject object using "sample_stl_sphere_BIN.stl".
"""
from AmpScan.core import AmpObject
stl_path = self.get_path("sample_stl_sphere_BIN.stl")
self.amp = AmpObject(stl_path)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment