-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
63 lines (45 loc) · 1.77 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
from chromatic_tda import ChromaticAlphaComplex, plot_six_pack, plot_labeled_point_set
import numpy as np
from matplotlib import pyplot as plt
def run_test():
pass
# for embedding in TestBars().single_test('two_circles_cc', return_detailed=True):
# for group, result in embedding.items():
# print(group.ljust(12), result)
# print()
# points = np.random.random((50, 2))
# labels = list(map(int, 2 * np.random.random(len(points))))
# cplx = ChromaticAlphaComplex(points, labels).get_simplicial_complex(sub_complex=((0,),))
# TimingAnalysis(
# n=1000,
# color_range_splits=(.5, 1),
# sub_complex='monochromatic'
# ).run()
# TimingUtils().flush()
#
# TimingAnalysis(
# n=500,
# color_range_splits=(.3, .6),
# sub_complex='monochromatic'
# ).run()
def run_test_plot():
points = np.random.random((50, 2))
labels = list(map(int, 2 * np.random.random(len(points))))
cplx = ChromaticAlphaComplex(points, labels).get_simplicial_complex(sub_complex='0')
fig, axs = plt.subplots(3, 2, figsize=(10, 15))
plot_six_pack(cplx, axs = axs)
plt.show()
def main():
# run_test_plot()
points = np.random.random((50, 2))
labels = list(map(int, 2 * np.random.random(len(points))))
plot_labeled_point_set(points, labels)
cplx = ChromaticAlphaComplex(points, labels).get_simplicial_complex(sub_complex='mono-chromatic')
plot_six_pack(cplx)
cplx_torus = ChromaticAlphaComplex(points, labels,
torus=True, xrange=(0, 1), yrange=(0, 1),
).get_simplicial_complex(sub_complex='mono-chromatic')
plot_six_pack(cplx_torus)
plt.show()
if __name__ == "__main__":
main()