Skip to content

Commit

Permalink
fixed remap bug
Browse files Browse the repository at this point in the history
  • Loading branch information
stsouko committed Jan 2, 2021
1 parent 37ddb28 commit af9bc72
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CGRtools/containers/common.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2018-2020 Ramil Nugmanov <nougmanoff@protonmail.com>
# Copyright 2018-2021 Ramil Nugmanov <nougmanoff@protonmail.com>
# This file is part of CGRtools.
#
# CGRtools is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -257,8 +257,10 @@ def remap(self, mapping: Dict[int, int], *, copy: bool = False):

# deep copy of bonds
for n, m_bond in self._bonds.items():
n = mg(n, n)
hb[n] = hbn = {}
for m, bond in m_bond.items():
m = mg(m, m)
if m in hb: # bond partially exists. need back-connection.
hbn[m] = hb[m][n]
else:
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2014-2020 Ramil Nugmanov <nougmanoff@protonmail.com>
# Copyright 2014-2021 Ramil Nugmanov <nougmanoff@protonmail.com>
# This file is part of CGRtools.
#
# CGRtools is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -43,7 +43,7 @@ def finalize_options(self):

setup(
name='CGRtools',
version='4.1.5',
version='4.1.6',
packages=['CGRtools', 'CGRtools.algorithms', 'CGRtools.algorithms.components', 'CGRtools.containers',
'CGRtools.files', 'CGRtools.files._mdl', 'CGRtools.periodictable', 'CGRtools.periodictable.element',
'CGRtools.utils', 'CGRtools.attributes'],
Expand Down

0 comments on commit af9bc72

Please sign in to comment.