Repository navigation
fix: correct bond reading mechanism from input coordinates - #1
Merged
Merged
Conversation
amorehead
approved these changes
Oct 26, 2026
amorehead
left a comment
Contributor
There was a problem hiding this comment.
LGTM. Thanks for your contribution!
There was a problem hiding this comment.
🟡 Changes recommended
Sidecar-backed ligand inputs now require Open Babel before their precomputed bonds can be loaded, breaking those inputs when it is unavailable.
1 open issue
What changed in this PR
This PR addresses missing molecular connectivity in zatom2 design by moving bond perception into the shared inference-input conversion path.
Changes:
- Perceive ligand bonds using preserved native coordinates before inference transforms.
- Share perception logic with the validation dataset and avoid repeated perception.
- Add regression coverage for the CLI’s
ContigJsonDatasetloading path.
| File | Description |
|---|---|
tests/test_bond_sidecar.py |
Tests inference bond perception without a sidecar. |
src/nucleus/utils/datasets.py |
Reuses shared perception logic and skips it when already completed. |
src/nucleus/utils/bond_sidecar.py |
Adds the shared native-coordinate bond-perception helper. |
src/nucleus/inference_input_parsing.py |
Invokes bond perception during inference-input conversion. |
Review effort: Balanced
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.

docs/inference.mdsays molecule structure prediction perceives bonds with Open Babel whenbond_sidecar_path=null, but onlyZatomContigJsonDataset(validation) did this.zatom2 designloads specs through RFD3'sContigJsonDataset, so without a sidecar the model got an almost emptytoken_bondsgraph and generated molecules with the right formula but the wrong connectivity.to_pipeline_input, which every inference path goes through._can_perceive_ligand_bondstobond_sidecar.pyand share one helper withZatomContigJsonDataset(no double perception; sidecars still take precedence).test_contig_inference_perceives_bonds_without_sidecar, covering the CLI loading path.