Change IUPAC metal->non-metal single bonds to dative#6038
Merged
Conversation
added 7 commits
February 1, 2023 15:48
Fix expected test results.
Explicitly exclude H, He, F, Ne from dative bonds. Fix tests.
greglandrum
requested changes
Feb 5, 2023
Member
greglandrum
left a comment
There was a problem hiding this comment.
Some comments here, most of which are addressed by the PR I just did against your branch.
Comment on lines
+930
to
+935
| // Version 10 files can be read by 11, but not vice versa. | ||
| if (doc["rdkitjson"]["version"].GetInt() != currentRDKitJSONVersion) { | ||
| throw FileParseException("Bad Format: bad version in JSON"); | ||
| if (!(doc["rdkitjson"]["version"].GetInt() == 10 && | ||
| currentRDKitJSONVersion == 11)) { | ||
| throw FileParseException("Bad Format: bad version in JSON"); | ||
| } |
Member
There was a problem hiding this comment.
I'd rather just commit to backwards compatibility here - we'll continue to read previous versions of the JSON format in the future. I don't think we want to do this for versions below 10 though, so how about making the check here:
if (int jsonVersion=doc["rdkitjson"]["version"].GetInt(); jsonVersion > currentRDKitJSONVersion || jsonVersion<10)
| // from the non-metal to the metal. | ||
|
|
||
| auto isMetal = [](const Atom *a) -> bool { | ||
| // This is the list of not metal atoms from QueryOps.cpp |
Member
There was a problem hiding this comment.
Not a request for a change, but I suspect that we're going to want to adjust this list to make it less permissive.
suggestions for PR
Closed
ricrogz
pushed a commit
to ricrogz/rdkit
that referenced
this pull request
Feb 7, 2023
* Change atom to metal bonds from single to dative if appropriate. * Pedantic change whilst I was in the area. * Reinstate all tests, leave in debugging writes to see failing tests. * Re-did it. Failing tests now pass. * Move any positive charge from the non-metal to the metal. Fix expected test results. * Write dative bond to JSON. * Bump currentRDKitJSONVersion to 11, but allow parser to still read 10. * Only move 1 unit of charge at a time from non-metal to metal. * Greg's hack to not do it for O+ and N+ etc. Explicitly exclude H, He, F, Ne from dative bonds. Fix tests. * Update expected PostGres json version to 11. * suggestions for PR * Correct comment. --------- Co-authored-by: David Cosgrove <david@cozchemix.co.uk> Co-authored-by: greg landrum <greg.landrum@gmail.com>
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.
Reference Issue
Addresses #6019
What does this implement/fix? Explain your changes.
As suggested by @greglandrum, this changes surplus single bonds to metals to dative in MolOps.cc::cleanUp.
Any other comments?