You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ak.arctan2 uses the "where" parameter incorrectly. #5149
This is true of every function that uses "where" in arkouda/numpy/numeric.py.
The numpy counterparts of all of these functions only use "where" if "out" is also used. We don't have "out" in any of our functions.
ak.arctan2 uses "where" incorrectly.
np.arctan2 only uses "where" if the "out" parameter is also specified. If "where" is True, it puts arctan2(a,b) in "out." If "where" is False, it leaves the "out" parameter unchanged. So, for example:
a = np.arange(17)
b = np.arange(17) - 8
c = np.ones(17)
np.arctan2(b,a,where=False)
array([1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.])
Instead, ak.arctan2 returns arctan2(a,b) when "where" is True, and a/b when "where" is False.
This can cause divide-by-zeros. In an upcoming PR where we generate RuntimeWarnings on divide-by-zero, this causes test_arctan2 to fail, because both arctan2 and test_arctan2 divide by denom (which can include zeros) when where is False.
I suggest eliminating the "where" parameter from ak.arctan2, since it depends on "out," and we don't incorporate the "out" parameter anywhere in arkouda that I know of.
Activity
Adds runtime warning on divide-by-zero, fixes use of "out" and "where…