Skip to content

Commit be67b6b

Browse files
pykaoKen Kao
andauthored
solved diving by zero bug (#65)
Co-authored-by: Ken Kao <KenKao@Kens-MacBook-Pro.local>
1 parent 7018a19 commit be67b6b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

DeepPurpose/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,10 @@ def convert_y_unit(y, from_, to_):
858858
y = 10**(-y) / 1e-9
859859

860860
if to_ == 'p':
861-
y = -np.log10(y*1e-9)
861+
if y == 0:
862+
y = -np.log10(10**-10)
863+
else:
864+
y = -np.log10(y*1e-9)
862865
elif to_ == 'nM':
863866
y = y
864867

0 commit comments

Comments
 (0)