Skip to content

Commit

Permalink
added hint typing for protonation functs
Browse files Browse the repository at this point in the history
  • Loading branch information
jonwzheng committed Jun 4, 2024
1 parent 2058cdb commit 7d20e94
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions rdtools/mol.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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

Check warning on line 295 in rdtools/mol.py

View check run for this annotation

Codecov / codecov/patch

rdtools/mol.py#L294-L295

Added lines #L294 - L295 were not covered by tests


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.
Expand All @@ -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.
Expand Down

0 comments on commit 7d20e94

Please sign in to comment.