Skip to content

Commit

Permalink
use _valence function to get valences
Browse files Browse the repository at this point in the history
  • Loading branch information
fgrunewald committed May 5, 2024
1 parent 2bf7c79 commit 823fcec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cgsmiles/pysmiles_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def rebuild_h_atoms(mol_graph, keep_bonding=False):
bonds = round(sum([mol_graph.edges[(node, neigh)]['order'] for neigh in\
mol_graph.neighbors(node)]))
charge = mol_graph.nodes[node].get('charge', 0)
hcount = pysmiles.smiles_helper.VALENCES[ele][0] -\
hcount = pysmiles.smiles_helper._valence(mol_graph, node, minimum=0) -\
bonds +\
charge
# in this case we only rebuild hydrogen atoms that are not
Expand Down

0 comments on commit 823fcec

Please sign in to comment.