Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
hadim committed Oct 14, 2022
1 parent 881548c commit f85124b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
7 changes: 2 additions & 5 deletions datamol/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from ._version import __version__

from .types import Mol
from .types import BondType
from .types import ChemicalReaction

from . import utils

Expand Down Expand Up @@ -128,8 +130,3 @@
from .graph import get_all_path_between
from .graph import match_molecular_graphs
from .graph import reorder_mol_from_template

from .reactions import rxn_from_smarts
from .reactions import rxn_from_block
from .reactions import apply_reaction
from .reactions import is_reaction_ok
2 changes: 1 addition & 1 deletion datamol/reactions/_attachments.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def convert_attach_to_isotope(
smiles = add_brackets_to_attachment_points(smiles)

# reg matching seems to be the most effective
subs_reg = "[\g<1>{}]"
subs_reg = r"[\g<1>{}]"
if same_isotope:
subs_reg = "[1{}]"
smiles = re.sub(ATTACHMENT_POINT_NUM_REGEXP, subs_reg.format(ATTACHMENT_POINT_TOKEN), smiles)
Expand Down
3 changes: 3 additions & 0 deletions datamol/types.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
from rdkit import Chem
from rdkit.Chem import rdChemReactions

Mol = Chem.rdchem.Mol
BondType = Chem.rdchem.BondType
ChemicalReaction = rdChemReactions.ChemicalReaction
3 changes: 2 additions & 1 deletion docs/api/datamol.reactions.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# `datamol.reactions`

::: datamol.reactions
::: datamol.reactions._reactions
::: datamol.reactions._attachments

0 comments on commit f85124b

Please sign in to comment.