示例#1
0
 def test_upper_tri_coulomb_matrix(self):
     """
     Test upper triangular CoulombMatrix.
     """
     f = cm.CoulombMatrix(self.mol.GetNumAtoms(), upper_tri=True)
     rval = f([self.mol])
     size = np.triu_indices(self.mol.GetNumAtoms())[0].size
     assert rval.shape == (1, self.mol.GetNumConformers(), size)
示例#2
0
 def test_coulomb_matrix(self):
     """
     Test CoulombMatrix.
     """
     f = cm.CoulombMatrix(self.mol.GetNumAtoms())
     rval = f([self.mol])
     assert rval.shape == (1, self.mol.GetNumConformers(),
                           self.mol.GetNumAtoms(), self.mol.GetNumAtoms())
示例#3
0
 def test_coulomb_matrix_padding(self):
     """
     Test CoulombMatrix with padding.
     """
     f = cm.CoulombMatrix(max_atoms=self.mol.GetNumAtoms() * 2)
     rval = f([self.mol])
     size = np.triu_indices(self.mol.GetNumAtoms() * 2)[0].size
     assert rval.shape == (1, self.mol.GetNumConformers(), size)
示例#4
0
 def test_coulomb_matrix_padding(self):
     """
     Test CoulombMatrix with padding.
     """
     max_atoms = self.mol.GetNumAtoms() * 2
     f = cm.CoulombMatrix(max_atoms=max_atoms)
     rval = f([self.mol])
     assert rval.shape == (1, self.mol.GetNumConformers(), max_atoms,
                           max_atoms)
示例#5
0
 def test_coulomb_matrix_hydrogens(self):
     """
     Test no hydrogen removal.
     """
     f = cm.CoulombMatrix(max_atoms=self.mol.GetNumAtoms(),
                          remove_hydrogens=False)
     rval = f([self.mol])
     size = np.triu_indices(self.mol.GetNumAtoms())[0].size
     assert rval.shape == (1, self.mol.GetNumConformers(), size)
示例#6
0
 def test_coulomb_matrix_no_hydrogens(self):
     """
     Test hydrogen removal.
     """
     mol = Chem.RemoveHs(self.mol)
     assert mol.GetNumAtoms() < self.mol.GetNumAtoms()
     f = cm.CoulombMatrix(max_atoms=mol.GetNumAtoms(),
                          remove_hydrogens=True)
     rval = f([self.mol])  # use the version with hydrogens
     size = np.triu_indices(mol.GetNumAtoms())[0].size
     assert rval.shape == (1, mol.GetNumConformers(), size)