diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 5d4c0b7174f856f03407cbcf43ee3ccbf820bb58..0000000000000000000000000000000000000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,22 +0,0 @@ -cmake_minimum_required(VERSION 3.16) -project(grouper) - -set(CMAKE_CXX_STANDARD 14) - -find_package(Python 3.8 COMPONENTS Interpreter Development REQUIRED) -find_package(OpenMP) - -if(Python_FOUND) - message(STATUS "Python Found: ${Python_EXECUTABLE}") - message(STATUS "Python Found: ${Python_INCLUDE_DIRS}") - message(STATUS "Python Found: ${Python_LIBRARIES}") - message(STATUS "Python Found: ${Python_LIBRARY_DIRS}") - include_directories(${Python_INCLUDE_DIRS}) -endif() - -add_library(grouper SHARED meanshift.cpp) -SET_TARGET_PROPERTIES(grouper PROPERTIES PREFIX "") -if(Python_FOUND) - target_link_libraries(grouper ${Python_LIBRARIES} OpenMP::OpenMP_CXX) -endif() - diff --git a/test.py b/test.py deleted file mode 100644 index dd5366e5c91ee0fce030b88adb240df26a03b535..0000000000000000000000000000000000000000 --- a/test.py +++ /dev/null @@ -1,18 +0,0 @@ -import grouper -import numpy as np - -a = np.array([[1.0, 2.0],[3.0,4.0],[5.0,6.0]]) -f = np.array([1.0,2.0,3.0]) - -g = grouper.Grouper() - -g.readCoordinates(a,f) - -g.setLookDistance(5.0) -g.setGroupingDistance(5.0) - -g.run() -b = [] -g.group(b) - -print(b) diff --git a/testlsm.py b/testlsm.py deleted file mode 100644 index dfd4b4a37c95d91f5f1a65289a8e242ee5ed491b..0000000000000000000000000000000000000000 --- a/testlsm.py +++ /dev/null @@ -1,6 +0,0 @@ -import lsmtool - -s = lsmtool.load('test_large.sky') - -s.group('meanshift', byPatch=True,lookDistance=0.075,groupingDistance=0.01) - diff --git a/tests/test_apparent_sky.txt b/tests/apparent.sky similarity index 100% rename from tests/test_apparent_sky.txt rename to tests/apparent.sky diff --git a/tests/test_group.py b/tests/test_group.py deleted file mode 100644 index 7a08f8691a6435eb892385639cd804fb783f9344..0000000000000000000000000000000000000000 --- a/tests/test_group.py +++ /dev/null @@ -1,12 +0,0 @@ -import lsmtool - -s = lsmtool.load('test_apparent_sky.txt') - -s.group('meanshift', byPatch=True,lookDistance=0.075,groupingDistance=0.01) - -if (len(s.getPatchPositions()) == 67): - print("Test successful.") -else: - print("Test failed. (Did you build with c++ extensions? This test may fail for the pure python code.)") - - diff --git a/tests/test_lsmtool.py b/tests/test_lsmtool.py index 1fbbe5fa8ca1e47e98fd16550685f57047a5f863..77767190de5a346c8760766fc13147952cd1c9c0 100644 --- a/tests/test_lsmtool.py +++ b/tests/test_lsmtool.py @@ -5,6 +5,7 @@ import os s = lsmtool.load('tests/no_patches.sky') +s2 = lsmtool.load('tests/apparent.sky') def test_select(): @@ -94,3 +95,8 @@ def test_plot(): s.plot('tests/plot.pdf') assert os.path.exists('tests/plot.pdf') + +def test_meanshift(): + print('Group the model with the meanshift algorithm') + s2.group('meanshift', byPatch=True, lookDistance=0.075, groupingDistance=0.01) + assert len(s2.getPatchPositions()) == 67