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

Allow unrecognized atom types when strictParsing=False #5891

Conversation

greglandrum
Copy link
Member

We should just read them in as dummies instead of throwing an exception.

There's a light bit of refactoring in here as well.

We should just read them in as dummies instead of throwing an exception.
A bit of light refactoring to accompany that
@greglandrum greglandrum added this to the 2022_09_4 milestone Dec 23, 2022
@@ -1378,6 +1378,21 @@ void setRGPProps(const std::string_view symb, Atom *res) {
std::string symbc(symb);
res->setProp(common_properties::dummyLabel, symbc);
}

void lookupAtomicNumber(Atom *res, const std::string &symb, bool strictParsing) {
try {
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems like using exceptions is a pretty heavy hammer, is there another way to tell whether we have a valid atomic number?

Copy link
Contributor

Choose a reason for hiding this comment

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

I take it back, it looks like this should be (TM) faster than an if statement.

@bp-kelley bp-kelley merged commit 286cb21 into rdkit:master Dec 28, 2022
@greglandrum greglandrum deleted the fix/allow_bad_atom_names_without_strictParsing branch December 28, 2022 17:37
greglandrum added a commit that referenced this pull request Feb 23, 2023
We should just read them in as dummies instead of throwing an exception.
A bit of light refactoring to accompany that
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants