coleygroup / molpal

active learning for accelerated high-throughput virtual screening
MIT License
159 stars 36 forks source link

Bug/too few scores #34

Closed degraff-roivant closed 2 years ago

degraff-roivant commented 2 years ago

Description

When k is large enough in early iterations, there may be too few valid scores from which to calculate a top-k average. This results in a TypeError of trying to sum over an iterable of Optional[float]. This PR adds a simple change to convert these Nones to 0s in the sum() call. This depresses the top-k average, but I would argue that's logically correct when the top-k contains invalid scores.

Checklist