From 7d20e9476949d704c55dab6e7b14a6e8f0ed1517 Mon Sep 17 00:00:00 2001 From: jonwzheng Date: Tue, 4 Jun 2024 13:01:36 -0400 Subject: [PATCH] added hint typing for protonation functs --- rdtools/mol.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/rdtools/mol.py b/rdtools/mol.py index 30381aad..8902f07a 100644 --- a/rdtools/mol.py +++ b/rdtools/mol.py @@ -239,7 +239,7 @@ def is_implicit(mol : Chem.RWMol): def uncharge_mol(mol : Chem.RWMol, - method = "all"): + method : str = "all"): """ Uncharges a molecule, adding or removing hydrogens wherever necessary. @@ -291,14 +291,11 @@ def uncharge_mol(mol : Chem.RWMol, if get_formal_charge(mol) == 0: return mol - # TODO: identify if we want the final form to be re-atom mapped, especially if new atoms are added/removed. - # Also whether these should have implicit H, e.g. "CC(=O)[O-]" --> "[C:1]([C:2](=[O:3])[OH:4])([H:5])([H:6])[H:7]" - warnings.warn(f"Unable to uncharge: got {mol_to_smiles(mol)}") return mol -def protonate_at_site(mol, site): +def protonate_at_site(mol : Chem.RWMol, site : int): ''' Add a proton of a mol object at the provided index. @@ -324,7 +321,7 @@ def protonate_at_site(mol, site): return mol -def deprotonate_at_site(mol, site): +def deprotonate_at_site(mol : Chem.RWMol, site : int): ''' Remove a proton of a mol object at the provided index.