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)
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())
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)
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)
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)
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)