Skip to content

Commit

Permalink
Update reactor.py (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
neon-monster committed Dec 14, 2020
1 parent 1be4140 commit b83f2cd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CGRtools/reactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from typing import Union, Iterable
from ._functions import lazy_product
from .containers import QueryContainer, QueryCGRContainer, MoleculeContainer, CGRContainer, ReactionContainer
from .containers.bonds import Bond
from .periodictable import Element, DynamicElement


Expand All @@ -50,8 +51,15 @@ def __init__(self, reactants, products, delete_atoms):
if is_cgr:
atoms[n].update(p_is_radical=atom.p_is_radical, p_charge=atom.p_charge)

bonds = []
for n, m, b in products.bonds():
if is_cgr:
bonds.append((n, m, b))
else:
bonds.append((n, m, Bond(b.order[0])))

self.__atom_attrs = dict(atoms)
self.__bond_attrs = list(products.bonds())
self.__bond_attrs = bonds

def _patcher(self, structure, mapping):
elements = self.__elements
Expand Down

0 comments on commit b83f2cd

Please sign in to comment.