Repository navigation
fix: handle empty V3000 bond block - #314
Merged
Merged
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-42402321616 and opening html/index.html |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues block the change supporting explicit empty bond blocks in zero-bond V3000 molfiles.
No open issues 🎉
What changed in this PR
Fixes issue #52 by allowing the V3000 molfile parser to accept an explicit empty bond block when COUNTS declares zero bonds.
Changes:
- Consumes the optional empty bond block before parsing the remaining CTAB sections.
- Enables the regression test, checks expected methane output, and adds coverage rejecting nonempty bond blocks with a zero bond count.
- Documents the fix in the changelog.
| File | Description |
|---|---|
INCHI-1-TEST/tests/test_executable/test_github_52.py |
Verifies empty and omitted bond blocks succeed, while inconsistent bond data is rejected. |
INCHI-1-SRC/INCHI_BASE/src/mol_fmt3.c |
Handles the optional empty bond block during CTAB tail parsing. |
INCHI-1-DOC/CHANGELOG.md |
Records the fix for issue #52. |
Review effort: Balanced
fbaensch-beilstein
approved these changes
Nov 9, 2026
fbaensch-beilstein
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed and verified: CLI and libinchi tests pass, no regression diffs, and the MSVC build passes on Windows (dry-run release). Thanks!
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.
Summary
when
COUNTSdeclares zero bonds,MolfileV3000ReadBondsBlock()skips bond parsing, leaving an explicitly emptyBEGIN BOND/END BONDsection unread. The change handles that optional section inMolfileV3000ReadTailOfCTAB()and adds regression coverage.Type of change
!in title or footer; major bump)Checklist
./INCHI-1-TEST/build_with_cmake.sh all).editorconfig(4-space indent, LF, no trailing whitespace)ctestin thefull_buildtest dir)pytest INCHI-1-TEST/tests/test_executable)Related issues
Closes #52