Skip to content

swap carrier order in DoubleBondStereochemistry::create to satisfy bond alignment constraint - #1226

Merged
johnmay merged 5 commits into
cdk:mainfrom
uli-f:doublebondstereochemistry-create-alignment-fix
Oct 16, 2025
Merged

swap carrier order in DoubleBondStereochemistry::create to satisfy bond alignment constraint#1226
johnmay merged 5 commits into
cdk:mainfrom
uli-f:doublebondstereochemistry-create-alignment-fix

Conversation

@uli-f

@uli-f uli-f commented Sep 11, 2025

Copy link
Copy Markdown
Member
  • fix carrier consistency in DoubleBondStereochemistry::new
  • add tests for strict carrier swap behavior in DoubleBondStereochemistry::new
  • change DoubleBondStereochemistry::testMap_Map_Map to reflect changes in DoubleBondStereochemistry::create

…ts for strict carrier swap behavior in DoubleBondStereochemistry::create; change DoubleBondStereochemistry::testMap_Map_Map to reflect changes in DoubleBondStereochemistry::create
…to process carriers; move carrier swap logic from DoubleBondStereochemistry::create to overridden DoubleBondStereochemistry::processCarriers method
@Override
protected IBond[] processCarriers(IBond focus, IBond[] carriers) {
// Ensure that the constraint carrier[0] connected to focus.getBegin() is satisfied.
if (carriers[0].getOther(focus.getBegin()) == null) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

carriers[0].contains(focus.getBegin())

@johnmay

johnmay commented Sep 12, 2025

Copy link
Copy Markdown
Member

Looks good and simple fix but tests are complaining

@uli-f

uli-f commented Sep 12, 2025

Copy link
Copy Markdown
Member Author

Looks good and simple fix but tests are complaining

Will have a look at failing tests now that we are happy with the approach.

…ment-fix

Some additional null checks and fix the test assertion now the order …
@uli-f

uli-f commented Oct 16, 2025

Copy link
Copy Markdown
Member Author

@johnmay I've been pretty busy the last few weeks. Thanks for fixing this up, seems good to go now!

@johnmay
johnmay merged commit 834d1eb into cdk:main Oct 16, 2025
7 of 8 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.

2 participants