Skip to content

Fix AttributeError when installing QM9 dataset#10625

Open
prajwalnayaka wants to merge 1 commit intopyg-team:masterfrom
prajwalnayaka:QM9-RDkit-Nonetype-Attribute-Error
Open

Fix AttributeError when installing QM9 dataset#10625
prajwalnayaka wants to merge 1 commit intopyg-team:masterfrom
prajwalnayaka:QM9-RDkit-Nonetype-Attribute-Error

Conversation

@prajwalnayaka
Copy link

When downloading the QM9 dataset, the script encounters complex and very strained molecules which RDKit cannot parse; since it cannot successfully parse the molecule mol, its as a NoneType object. The AttributeError is thrown when the function tries to call the GetNumAtoms() on the NoneType molecule mol.

This fix adds a safety check to skip molecules that RDKit fails to parse (returning None), preventing a crash when calling GetNumAtoms().

Added a safety check to skip molecules that RDKit fails to parse (returning None), preventing a crash when calling GetNumAtoms().
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.

1 participant