Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion arc/species/converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1730,13 +1730,15 @@ def to_rdkit_mol(mol, remove_h=False, sanitize=True):
Adopted from rmgpy/molecule/converter.py

Args:
mol (Molecule): An RMG Molecule object for the conversion.
mol (Molecule, ARCSpecies): An ARCSpecies or RMG Molecule object for the conversion.
remove_h (bool, optional): Whether to remove hydrogen atoms from the molecule, ``True`` to remove.
sanitize (bool, optional): Whether to sanitize the RDKit molecule, ``True`` to sanitize.

Returns:
RDMol: An RDKit molecule object corresponding to the input RMG Molecule object.
"""
if type(mol) == ARCSpecies:
mol = mol.mol
atom_id_map = dict()

# only manipulate a copy of ``mol``
Expand Down
5 changes: 5 additions & 0 deletions arc/species/converter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3643,6 +3643,11 @@ def test_to_rdkit_mol(self):
rd_mol_block = Chem.MolToMolBlock(rd_mol).splitlines()
self._check_atom_connectivity_in_rd_mol_block(spc1.mol, rd_mol_block)

rd_mol = converter.to_rdkit_mol(spc1)
self.assertIsInstance(rd_mol, rdchem.Mol)
rd_mol_block = Chem.MolToMolBlock(rd_mol).splitlines()
self._check_atom_connectivity_in_rd_mol_block(spc1.mol, rd_mol_block)

xyz = {'symbols': ('O', 'C', 'C', 'C', 'C', 'H', 'H', 'H', 'H', 'H', 'H', 'H', 'H', 'H', 'H'),
'isotopes': (16, 12, 12, 12, 12, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
'coords': ((-1.3435816539552077, -1.2858724378615196, 1.2807152578949395),
Expand Down
Loading