JacksonBurns / mordred-community

Community-Maintained Version of mordred
https://jacksonburns.github.io/mordred-community/
BSD 3-Clause "New" or "Revised" License
44 stars 3 forks source link

RuntimeWarning: invalid value encountered in scalar power #18

Open LucaCappelletti94 opened 3 weeks ago

LucaCappelletti94 commented 3 weeks ago

Hi! Great idea maintaining Mordred! I wanted to let you know that, for some smiles, this line will introduce NaNs into the fingerprint raising the following error:

/home/cappelle/miniconda3/lib/python3.12/site-packages/mordred/_matrix_attributes.py:251: RuntimeWarning: invalid value encountered in scalar power
  s += (eig.vec[i, eig.max] * eig.vec[j, eig.max]) ** -0.5

I encountered this error when computing fingerprints for a large number of smiles, so it is a bit hard to understand which ones were the culprit. I will report them here if I identify them, but I thought important to let you know that it can indeed happen.

JacksonBurns commented 2 weeks ago

Hi @LucaCappelletti94 thanks for the kind words.

I've seen this error as well, but never tried to really track it down. I look forward to seeing the SMILES you identify that can cause this - I am sure we can figure it out with that information.