Update molecular inorganics bond handling (GHI # 218)#219
Open
nnuk wants to merge 9 commits into
Open
Conversation
Unit Test Coverage ReportCoverage Regression Summary
Find details on the base coverage at https://iupac-inchi.github.io/InChI/coverage/index.html Find details on this PR's coverage by downloading coverage-reports-27428034371 and opening html/index.html |
cthoyt
reviewed
Jun 4, 2026
|
@JanCBrammer this needs your review |
|
There's a blocker on this related to a lithium hydroxide molecule that needs discussion (how covalent bond is represented) between @gblanke02 and @nnuk Nauman has a specific structure in mind. Not sure if we have the expected result. |
cthoyt
reviewed
Jun 9, 2026
cthoyt
reviewed
Jun 9, 2026
cthoyt
reviewed
Jun 9, 2026
Contributor
|
He InChI internal bond types will be described by a section about the internal object that Christoph works on.
In terms of bond types only the first 4 bond types correspond directly with the molfile definitions, bond types >= 4 are used to describe the bond environment of an atoms, i.e. the types of the bonds leaving from an atom are listed in atom specific arrays. More will be found in the documentation
Cheers,
Gerd
Von: Nauman Ullah Khan ***@***.***>
Gesendet: Dienstag, 9. Juni 2026 16:04
An: IUPAC-InChI/InChI ***@***.***>
Cc: ***@***.***; Mention ***@***.***>
Betreff: Re: [IUPAC-InChI/InChI] Update molecular inorganics bond handling (GHI # 218) (PR #219)
@nnuk commented on this pull request.
________________________________
In INCHI-1-SRC/INCHI_BASE/src/strutil.h<#219 (comment)>:
@@ -111,6 +111,33 @@ extern "C"
int getElValenceforMolecularInorganics(int nPeriodicNum, int charge, int val_num);
/* Function retrieves element type value for molecular inorganics functionality*/
int getElTypeforMolecularInorganics(int nPeriodicNum);
+
+ /**
+ * @nnuk
+ *
+ * @brief Determine whether a metal-ligand bond must always be preserved
+ * during Molecular Inorganics preprocessing. Some description on
+ * how InChI sees the bond types:
+ * Bond type 1 = Single Bond
+ * Bond type 2 = Double Bond
+ * Bond type 3 = Triple Bond
+ * Bond type 4 = Aromatic Bond
I have to ask Gerd for the exact terminology. Will get updated.
—
Reply to this email directly, view it on GitHub<#219?email_source=notifications&email_token=AT3EDCI35A7QWRSL4TKSXML47AKNBA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTINBVHEZTIOBWGUYKM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#discussion_r3381234923>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AT3EDCIV464HDUVVBOOYJVD47AKNBAVCNFSM6AAAAACZQLUJGKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHM2DINJZGM2DQNRVGA>.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS<https://github.com/notifications/mobile/ios/AT3EDCILBKVGAMD5AB3PMA347AKNBA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTINBVHEZTIOBWGUYKM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y> and Android<https://github.com/notifications/mobile/android/AT3EDCPTC5P2SAGWRWBWJYL47AKNBA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTINBVHEZTIOBWGUYKM4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>. Download it today!
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
Contributor
|
The variable names are already pre-defined in the (legacy) code. For the time being we will not start a major re-factoring to come up to more descriptive names. Beside that, the meaning of “bond type” is pretty well understood in the cheminformatics area. See the Biovia CTFile document for that.
By the way, the bond type 9 means coordinative bonds in the CT File format but the meaning within InChI is different.
Von: Charles Tapley Hoyt ***@***.***>
Gesendet: Dienstag, 9. Juni 2026 16:07
An: IUPAC-InChI/InChI ***@***.***>
Cc: ***@***.***; Mention ***@***.***>
Betreff: Re: [IUPAC-InChI/InChI] Update molecular inorganics bond handling (GHI # 218) (PR #219)
@cthoyt commented on this pull request.
________________________________
In INCHI-1-SRC/INCHI_BASE/src/strutil.h<#219 (comment)>:
@@ -111,6 +111,33 @@ extern "C"
int getElValenceforMolecularInorganics(int nPeriodicNum, int charge, int val_num);
/* Function retrieves element type value for molecular inorganics functionality*/
int getElTypeforMolecularInorganics(int nPeriodicNum);
+
+ /**
+ * @nnuk
+ *
+ * @brief Determine whether a metal-ligand bond must always be preserved
+ * during Molecular Inorganics preprocessing. Some description on
+ * how InChI sees the bond types:
+ * Bond type 1 = Single Bond
+ * Bond type 2 = Double Bond
+ * Bond type 3 = Triple Bond
+ * Bond type 4 = Aromatic Bond
+ * Bond type 9 = Coordinative Bond
+ *
+ *
+ * @param at Input atom array.
why not pick more descriptive variable names?
I don't think anyone benefits from them being cryptic.
* atoms instead of at
* metal_atom_index instead of metal_idx
* neighboring_atom_index instead of neigh_idx
* bond_position instead of bond_pos
—
Reply to this email directly, view it on GitHub<#219?email_source=notifications&email_token=AT3EDCOIEQHSETOBALDYBPT47AKXVA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTINBVHEZTMMZSGYZ2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#pullrequestreview-4459363263>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AT3EDCJCWRF4U6XKFXYUIL347AKXVAVCNFSM6AAAAACZQLUJGKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHM2DINJZGM3DGMRWGM>.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS<https://github.com/notifications/mobile/ios/AT3EDCLGAFIYSAER76IDHQL47AKXVA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTINBVHEZTMMZSGYZ2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y> and Android<https://github.com/notifications/mobile/android/AT3EDCNMVA7YQQBLQHG2OT347AKXVA5CNFSNUABKM5UWIORPF5TWS5BNNB2WEL2QOVWGYUTFOF2WK43UKJSXM2LFO4XTINBVHEZTMMZSGYZ2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>. Download it today!
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
…rges Realize each type-9 (coordinative) bond as a single bond at the start of MolecularInorganicsPreprocessing, and cancel the paired +/- formal charges of the two bonded atoms (the donated lone pair becomes the shared bonding pair). This unifies the two equivalent coordinative-bond drawings - donor VAL set, or explicit +/- charges - so both yield the same InChI (e.g. NaOH drawn either way -> Na+ + OH-). Fixes the previously failing charged-input cases in test_molecularInorganics (now 11/11).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request resolves #218. Coordinative bond included in the condition to be evaluated before the disconnection of bonds.