Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1538 Add/Remove explicit hydrogens feature doesn't work if atom with problem valence present on canvas (crash happens) #1615

Merged
merged 3 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/c/indigo/src/indigo_misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ CEXPORT int indigoUnfoldHydrogens(int item)
if (IndigoBaseMolecule::is(obj))
{
BaseMolecule& bmol = obj.getBaseMolecule();
bmol.unfoldHydrogens(&markers, -1);
bmol.unfoldHydrogens(&markers, -1, true);
if (markers.count(1) > 0) // If some hydrogens found - layout it
{
// Layout hydrogens
Expand Down
2 changes: 1 addition & 1 deletion api/tests/integration/ref/basic/basic.py.out
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ False
****** Bad valence, smiles and unfold ********
C/C=C(/N(=O)O)\N(=O)O
CC=C(N(O)=O)N(O)=O
element: bad valence on N having 4 drawn bonds, charge 0, and 0 radical electrons
CC=C(N(O)=O)N(O)=O
****** Serialize and atom changing ********
CC[C@H](/C=C\C)N
C/C=C\[C@H](N)CC
Expand Down
6 changes: 6 additions & 0 deletions api/tests/integration/ref/basic/unfold_molecules.py.out
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ testing filename:
issue_1589.ket
Unfolded KET equal to expected
Folded KET equal to original

******* Test unfold bad valence *******
testing filename:
issue_1538.ket
Unfolded KET equal to expected
Folded KET equal to original
Loading
Loading