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

Fixes #7375 #7381

Merged
merged 6 commits into from May 16, 2024
Merged

Fixes #7375 #7381

merged 6 commits into from May 16, 2024

Conversation

ricrogz
Copy link
Contributor

@ricrogz ricrogz commented Apr 22, 2024

Fixes #7375

The fix is easy: just add a check ring info (and the proper initialization if not found) in the second condition in KekulizeFragment().

Besides that, this PR does something I've wanted to do since #6903 added specific checks for the different levels of ring info: updating the ring info checks in several code locations to check for the proper ring info level instead of just checking for initialization.

This last change broke some tests because it changed the canonicalization of some strings. This should make canonicalization more robust, since now it shouldn't depend on the ring info present on the input molecule anymore.

@greglandrum
Copy link
Member

My initial reaction is to disagree with the changes to require a particular level of ring finding. I appreciate that this makes it harder for people to generate misleading results, but we've always provided the option for client-code to skip (or approximate) parts of sanitization which may be time consuming. Doing this assumes that the author of the client code understands and is thinking about what they are doing and increase the odds that they will generate incorrect results.

I think it's worth talking about changing this "you can mess with the defaults, but you then should know what you are doing" approach, but it is a longer conversation and should result in a separate issue/PR that we can then point to.

Would you mind reducing this PR to just the bug fix and then we can have the conversation about the ring finding elsewhere?

@ricrogz
Copy link
Contributor Author

ricrogz commented May 9, 2024

Would you mind reducing this PR to just the bug fix and then we can have the conversation about the ring finding elsewhere?

Sure

Copy link
Member

@greglandrum greglandrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@greglandrum greglandrum merged commit d71e821 into rdkit:master May 16, 2024
12 checks passed
@ricrogz ricrogz deleted the issue_7375 branch May 16, 2024 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DetectChemistryProblems fails with traceback when run on mols coming from aromatic SMARTS
2 participants