-
Notifications
You must be signed in to change notification settings - Fork 845
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
Catch meanBondLen of 0.0 #6699
Catch meanBondLen of 0.0 #6699
Conversation
@@ -481,6 +481,7 @@ void drawMolACS1996(MolDraw2D &drawer, const ROMol &mol, | |||
|
|||
// **************************************************************************** | |||
void setACS1996Options(MolDrawOptions &opts, double meanBondLen) { | |||
PRECONDITION(meanBondLen > 0.0, "mean bond length <= 0 for ACS1996 mode") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this would be better as a ValueError than a PRECONDITION (which generally indicates a catastrophic programming failure, not bad input)
MolDraw2DSVG drawer(-1, -1); | ||
auto reactIter = rxn->beginReactantTemplates(); | ||
REQUIRE_THROWS(MolDraw2DUtils::setACS1996Options( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the exception is changed to ValueError, then this should also check specifically for that exception type.
Good point. Change pushed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Reference Issue
Fixes problem in discussion (not issue) #6683.
What does this implement/fix? Explain your changes.
Catches a zero mean bond length when setting the ACC1996 draw options.
Any other comments?