Skip to content

Commit

Permalink
Add test for reactions with dative bonds
Browse files Browse the repository at this point in the history
  • Loading branch information
avaucher committed Jul 18, 2024
1 parent 79260a1 commit 2aa887f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/test_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,16 @@ def test_multiple_products(rxn_mapper: RXNMapper):

results = rxn_mapper.get_attention_guided_atom_maps(rxns)
assert_correct_maps(results, expected)


def test_reaction_with_dative_bond(rxn_mapper: RXNMapper):
rxns = ["COC(=O)CCBr.O=C[O-]->[K+]>>COC(=O)CCOC(=O)C"]
expected = [
{
"mapped_rxn": "[CH3:1][O:2][C:3](=[O:4])[CH2:5][CH2:6]Br.[O:9]=[CH:8][O-:7]->[K+]>>[CH3:1][O:2][C:3](=[O:4])[CH2:5][CH2:6][O:7][C:8](=[O:9])[CH3:10]",
"confidence": 0.9322116305783666,
}
]

results = rxn_mapper.get_attention_guided_atom_maps(rxns, canonicalize_rxns=False)
assert_correct_maps(results, expected)

0 comments on commit 2aa887f

Please sign in to comment.