Update ExplicitMoleculeComponent warning to provide molecule name#720
Open
jaclark5 wants to merge 2 commits intoOpenFreeEnergy:mainfrom
Open
Update ExplicitMoleculeComponent warning to provide molecule name#720jaclark5 wants to merge 2 commits intoOpenFreeEnergy:mainfrom
jaclark5 wants to merge 2 commits intoOpenFreeEnergy:mainfrom
Conversation
atravitz
reviewed
Feb 2, 2026
| if not any(atom.GetAtomicNum() == 1 for atom in rdkit.GetAtoms()): | ||
| warnings.warn( | ||
| "Molecule doesn't have any hydrogen atoms present. " | ||
| f"Molecule, {name}, doesn't have any hydrogen atoms present. " |
Contributor
There was a problem hiding this comment.
Suggested change
| f"Molecule, {name}, doesn't have any hydrogen atoms present. " | |
| f"Molecule (name='{name}') doesn't have any hydrogen atoms present. " |
It's valid for the name to be an empty string, so this should make the message less confusing in that case.
|
No API break detected ✅ |
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.
Previously
ExplicitMoleculeComponenthas a warning:now it is more meaningful by listing the molecule name with it.
Tips
Since this will create a commit, it is best to make this comment when you are finished with your work.
Checklist
newsentryDevelopers certificate of origin