diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b2c84dc911ca607e8510a2631be6ef3f48bcce97..8f33e951e058875e420119bb6ed8ae634a28dcdf 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,3 +2,5 @@ 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 \ No newline at end of file diff --git a/AmpScan/registration.py b/AmpScan/registration.py index ce105833a3fb265ab13a848510ac974a20121bce..b09c12a8fa04ab7deabe636634c2d241773f913a 100644 --- a/AmpScan/registration.py +++ b/AmpScan/registration.py @@ -6,7 +6,7 @@ Copyright: Joshua Steer 2018, Joshua.Steer@soton.ac.uk import numpy as np import copy from scipy import spatial -from .core import AmpObject +from AmpScan.core import AmpObject import matplotlib.pyplot as plt class registration(object): @@ -36,9 +36,13 @@ class registration(object): Examples -------- + >>> import os + >>> import AmpScan + >>> basefh = os.getcwd()+"\\tests\\stl_file.stl" + >>> targfh = os.getcwd()+"\\tests\\stl_file_2.stl" >>> baseline = AmpScan.AmpObject(basefh) >>> target = AmpScan.AmpObject(targfh) - >>> reg = AmpScan.registration(steps=10, neigh=10, smooth=1).reg + >>> reg = AmpScan.registration(baseline, target, steps=10, neigh=10, smooth=1).reg """ def __init__(self, baseline, target, method='point2plane', *args, **kwargs): diff --git a/tests/doctests.py b/tests/doctests.py deleted file mode 100644 index 66e71b292ca6427b699ea2ff4934eafa1a009b52..0000000000000000000000000000000000000000 --- a/tests/doctests.py +++ /dev/null @@ -1,8 +0,0 @@ -import AmpScan.core as core -import AmpScan.trim as trim - -if __name__ == '__main__': - import doctest - doctest.testmod(core, verbose=True) - doctest.testmod(trim, verbose=True) - diff --git a/tests/stl_file_2.stl b/tests/stl_file_2.stl new file mode 100644 index 0000000000000000000000000000000000000000..5b51ee5627b7a86e1dd011f6b0ffc5dbd5d564eb --- /dev/null +++ b/tests/stl_file_2.stl @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0bd80b6e237a78b9968f4649f415718e58f8ca7a10db759f8d6fa55115c2a826 +size 757084