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

Expose multicolor highlights to MinimalLib #7787

Merged

Conversation

ptosco
Copy link
Contributor

@ptosco ptosco commented Sep 3, 2024

This PR exposes the multi-color highlight functionality to MinimalLib and adds relevant tests.
This code was originally part of #7322 and I have now extracted it to make #7322 easier to review.
I have also added a PRECONDITION in DrawMolMCHCircleAndLine::calcSymbolEllipse as I incurred in a segfault while testing with out-of-bounds atom indices, and added relevant tests .

- Make sure that out-of-bounds atom indices in highlight_atom_map do not cause a segfault
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

@@ -203,6 +203,7 @@ void DrawMolMCHCircleAndLine::calcSymbolEllipse(unsigned int atomIdx,
Point2D &centre,
double &xradius,
double &yradius) const {
PRECONDITION(atomIdx < atCds_.size() && atomIdx < atomLabels_.size(), "")
Copy link
Member

Choose a reason for hiding this comment

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

I will approve as-is, but it's not terrible to actually use that final argument to explain the failure. ;-)

@greglandrum greglandrum merged commit e4f4644 into rdkit:master Sep 3, 2024
12 checks passed
@greglandrum greglandrum added this to the 2024_09_1 milestone Sep 3, 2024
@ptosco ptosco deleted the expose-multimap-support-to-minilib branch September 5, 2024 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants