dlu.nandiv
fails on float inputs
#269
Labels
enhancement
New feature or request
low-priority
Low-priority issue that isn't likely to adressed soon
ZeroDivisionError Traceback (most recent call last)
Cell In[173], line 1
----> 1 dlu.nandiv(1.0, 0.0, -1)
File ~/mambaforge/envs/amigo/lib/python3.11/site-packages/dLux/utils/math.py:77, in nandiv(a, b, fill)
59 def nandiv(a: Array, b: Array, fill: Any = np.inf) -> Array:
60 """
61 Divides two arrays, replacing any NaNs with a fill value.
62
(...)
75 The result of the division.
76 """
---> 77 return np.where(b == 0, fill, a / b)
ZeroDivisionError: float division by zero
whereas
It should also probably be called
safe_div
The text was updated successfully, but these errors were encountered: