Skip to content
This repository was archived by the owner on Dec 8, 2024. It is now read-only.

Commit 07d0555

Browse files
authored
fixed bob float/int indices bug (#7)
1 parent 8f997cf commit 07d0555

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/representations.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
# SOFTWARE.
2222

2323
from __future__ import print_function
24+
from __future__ import division
2425

2526
import numpy as np
2627

@@ -36,7 +37,7 @@ def vector_to_matrix(v):
3637
exit(1)
3738

3839
n = v.shape[0]
39-
l = (-1 + int(np.sqrt(8*n+1)))/2
40+
l = (-1 + int(np.sqrt(8*n+1)))//2
4041
M = np.empty((l,l))
4142

4243
index = 0
@@ -100,10 +101,10 @@ def generate_bob(coordinates, nuclear_charges, atomtypes, size=23, asize={"O":3,
100101
if atom1 > atom2:
101102
continue
102103
if atom1 == atom2:
103-
size = size1*(size1-1)/2
104+
size = size1*(size1-1)//2
104105
feature_vector = np.zeros(size)
105106
sub_matrix = coulomb_matrix[np.ix_(pos1,pos1)]
106-
feature_vector[:pos1.size*(pos1.size-1)/2] = sub_matrix[np.triu_indices(pos1.size, 1)]
107+
feature_vector[:pos1.size*(pos1.size-1)//2] = sub_matrix[np.triu_indices(pos1.size, 1)]
107108
feature_vector.sort()
108109
descriptor.append(feature_vector[:])
109110
else:

0 commit comments

Comments
 (0)