Skip to content

Commit

Permalink
hydrogen processing fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
stsouko committed Feb 22, 2019
1 parent 98d4606 commit c006de2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions CGRtools/containers/molecule.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ def implicify_hydrogens(self):
c = 0
for n, atom in self.atoms():
if atom.element == 'H':
m = next(self.neighbors(n))
if self._node[m].element != 'H':
explicit[m].append(n)
for m in self.neighbors(n):
if self._node[m].element != 'H':
explicit[m].append(n)

for n, h in explicit.items():
atom = self._node[n]
Expand Down
3 changes: 2 additions & 1 deletion CGRtools/periodictable/data.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright 2017, 2018 Ramil Nugmanov <stsouko@live.ru>
# Copyright 2017-2019 Ramil Nugmanov <stsouko@live.ru>
# This file is part of CGRtools.
#
# CGRtools is free software; you can redistribute it and/or modify
Expand All @@ -22,6 +22,7 @@
# http://onlinelibrarystatic.wiley.com/marvin/help/sci/ValenceCalculator.html
# elements, charge, radical, bonds, [implicitH]
_valence_rules = (
('H', -1, 0, 0, 0),
# elemental Me
(('Li', 'Na', 'K', 'Rb', 'Cs', 'Fr'), 0, 0, 0, 0),
# 1 bond is accepted
Expand Down

0 comments on commit c006de2

Please sign in to comment.