summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Luevano Alvarado <55825613+luevano@users.noreply.github.com>2020-02-29 06:23:02 -0700
committerDavid Luevano Alvarado <55825613+luevano@users.noreply.github.com>2020-02-29 06:23:02 -0700
commitfe4e5afebaf7320ba5bed7f159c84bc5d1e5faec (patch)
tree0cedb1e66e98fcf75fb3a703dad9c333584f1cc0
parent86faabeac5aed75c1dfc883fe757c21eba94b645 (diff)
Rename bos to bob
-rw-r--r--ml_exp/compound.py9
-rw-r--r--ml_exp/representations.py15
2 files changed, 10 insertions, 14 deletions
diff --git a/ml_exp/compound.py b/ml_exp/compound.py
index 1598fa482..4dbd8c95c 100644
--- a/ml_exp/compound.py
+++ b/ml_exp/compound.py
@@ -116,18 +116,15 @@ class Compound:
forces,
size=size)
- def gen_bos(self,
- size=23,
- stuff='bonds'):
+ def gen_bob(self,
+ size=23):
"""
Generate the Bag of Stuff for the compound.
size: compound size.
- stuff: elements of the bag, by default the known bag of bonds.
"""
self.bos = bag_of_stuff(self.cm,
self.atoms,
- size=size,
- stuff=stuff)
+ size=size)
def read_xyz(self,
filename):
diff --git a/ml_exp/representations.py b/ml_exp/representations.py
index ea079595e..d4e79c7d9 100644
--- a/ml_exp/representations.py
+++ b/ml_exp/representations.py
@@ -308,10 +308,9 @@ def check_bond(bags,
return False, None
-def bag_of_stuff(cm,
+def bag_of_bonds(cm,
atoms,
- size=23,
- stuff='bonds'):
+ size=23):
"""
Creates the Bag of Bonds using the Coulomb Matrix.
cm: coulomb matrix.
@@ -366,19 +365,19 @@ generated as the vector of eigenvalues, try (re-)generating the CM.')
bonds.append(''.join(sorted([a_i, a_j])))
bonds = atom_list + bonds
- # Create the final vector for the bos.
- bos = np.zeros(bond_size, dtype=float)
+ # Create the final vector for the bob.
+ bob = np.zeros(bond_size, dtype=float)
c_i = 0
for i, bond in enumerate(bonds):
checker = check_bond(bags, bond)
if checker[0]:
for j, num in enumerate(sorted(bags[checker[1]][1:])[::-1]):
- # Use c_i as the index for bos if the zero padding should
+ # Use c_i as the index for bob if the zero padding should
# be at the end of the vector instead of between each bond.
- bos[i*size + j] = num
+ bob[i*size + j] = num
c_i += 1
else:
print(f'Error. Bond {bond} from bond list coudn\'t be found',
'in the bags list. This could be a case where the atom',
'is only present oncce in the molecule.')
- return bos
+ return bob