Skip to content

Commit 2eff54b

Browse files
fix clustercut test
1 parent e7d538c commit 2eff54b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

nested_sampling/clustering/clusterdetect_1d_test.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import clusterdetect
1+
from . import clusterdetect
22
import matplotlib.pyplot as plt
33
import numpy
44
from numpy import log10, log, exp
@@ -21,12 +21,13 @@ def test_clusterdetect():
2121
fout = open('x_1d_clustergraph.dot', 'w')
2222
fout.write("digraph g{\n")
2323
for i, (a, b, dist, entries) in enumerate(cluster):
24-
#print '%3d%s %3d%s %.2f %3d' % (a,
25-
# '*' if a < n else ' ', b, '*' if b < n else ' ', dist, entries)
24+
a, b = int(a), int(b)
25+
#print('%3d%s %3d%s %.2f %3d' % (a,
26+
# '*' if a < n else ' ', b, '*' if b < n else ' ', dist, entries))
2627
if a < n:
27-
fout.write("%d[label=%.3f,shape=square];\n" % (a, u[a]))
28+
fout.write("%d[label=%.3f,shape=square];\n" % (a, u[a,0]))
2829
if b < n:
29-
fout.write("%d[label=%.3f,shape=square];\n" % (b, u[b]))
30+
fout.write("%d[label=%.3f,shape=square];\n" % (b, u[b,0]))
3031
fout.write("%d -> %d [label=%.2f];\n" % (i+n, a, dist))
3132
fout.write("%d -> %d [label=%.2f];\n" % (i+n, b, dist))
3233
tree[i + n] = (a, b, dist, entries)

0 commit comments

Comments
 (0)