Skip to content

fix atom property cleanup in DepictionGenerator#1203

Merged
johnmay merged 1 commit intocdk:mainfrom
uli-f:depict-gen-atom-property-cleanup-fix
Jul 17, 2025
Merged

fix atom property cleanup in DepictionGenerator#1203
johnmay merged 1 commit intocdk:mainfrom
uli-f:depict-gen-atom-property-cleanup-fix

Conversation

@uli-f
Copy link
Copy Markdown
Member

@uli-f uli-f commented Jul 15, 2025

  • update DepictionGenerator to remove atom value annotations
  • add test for atom property annotation label cleanup

@egonw
Copy link
Copy Markdown
Member

egonw commented Jul 16, 2025

@uli-f, I am not entirely sure what is the intention. If I look at the test, what is actually being tested by the repetitive .depict(atomContainer) call? Without the fix, what happens that should not have happened?

@uli-f
Copy link
Copy Markdown
Member Author

uli-f commented Jul 16, 2025

@uli-f, I am not entirely sure what is the intention. If I look at the test, what is actually being tested by the repetitive .depict(atomContainer) call? Without the fix, what happens that should not have happened?

Yes, that's correct, the test is about the repetitive .depict(atomContainer) call.

Without the fix the property StandardGenerator.ANNOTATION_LABEL that is meant to be used temporarily during depiction generation (at least that's how I understood the intention) is not removed. So there is an unintended side effect to the method call and the 2nd time depict is called an UnsupportedOperationException is thrown b/c only one StandardGenerator.ANNOTATION_LABEL per atom is allowed.

@johnmay
Copy link
Copy Markdown
Member

johnmay commented Jul 17, 2025

It's not quite temporary, you can usefully use it for whatever you want. If however it has been set by one of the options you are correct it should be cleaned up.

p.s. the atom value/comments you can input like this. Useful for locant labelling which are not purely atom numbers (e.g. OPSIN has a mode to generate them).

C1CCCCC1 |$_AV:1a;2b;3;4$|

@johnmay johnmay merged commit fe44b81 into cdk:main Jul 17, 2025
6 of 7 checks passed
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.

3 participants