def test(): import pickle from filter import Filter import matplotlib.pyplot as plt data = pickle.load( open( '/Users/martinomilani/Documents/III_semester/PACS/shapegraph/data.pickle', 'rb')) plt.plot([x[0] for x in data], [x[1] for x in data], 'ro') plt.show() f = Filter.factory('Projection') cover = Cover.factory('UniformCover') filter_values = f(data) cover.fit(filter_values, data) for fiber in cover: print('\n new fiber') print(fiber._fiber_index) print(fiber._filter_minima) print(fiber._filter_maxima) print(fiber._pointlabels) print(len(fiber._points)) plt.plot([x[0] for x in fiber._points], [x[1] for x in fiber._points], 'ro') plt.show() print('OK')
def test(): data = pickle.load( open( '/Users/martinomilani/Documents/III_semester/PACS/shapegraph/data.pickle', 'rb')) f = Filter.factory('Projection') cover = Cover.factory('BalancedCover') filter_values = f(data) cover.fit(filter_values, data) cluster = Cluster.factory('Linkage') for fiber in cover: plt.plot([x[0] for x in fiber._points], [x[1] for x in fiber._points], 'ro') plt.show() cluster(fiber) print(len(fiber._nodes)) print('\nOK')
def test(): data = pickle.load(open('/Users/martinomilani/Documents/III_semester/PACS/pymapper/data.pickle', 'rb')) f = Filter.factory('Projection') cover = Cover.factory('UniformCover') filter_values = f(data) cover.fit(filter_values, data) cluster = Cluster.factory('Linkage') for fiber in cover: cluster(fiber) print(len(fiber._nodes)) print('OK\n') complex = Complex() print(cover.intersecting_dict) complex.fit(cover) complex.plot() """testing _rename_nodes