Repository navigation
Closes #2400: Add arc and hyperbolic trig functions - #2447
Conversation
Ethan-DeBandi99
left a comment
There was a problem hiding this comment.
I think @pierce314159 covered just about everything. I agree his changes.
Ethan-DeBandi99
left a comment
There was a problem hiding this comment.
Looks good. I was a little concerned about some of the typing based on the Chapel documentation, but I pulled it down and everything is working as far as I see. I asked @pierce314159 to double check to make sure I did not miss anything.
stress-tess
left a comment
There was a problem hiding this comment.
some small stuff mostly in the tests. The way they are set up rn, we end up with all zeros a fair amount of the time. We should also test outliers like 0, inf and -inf and stuff like that
The only other thing is i found some weird behavior with arctan2 while testing. I'm not sure what's causing this
In [16]: ak.arctan2(ak.arange(10), 2**63 + 1)
Out[16]: array([3.1415926535897931 3.1415926535897931 3.1415926535897931 3.1415926535897931 3.1415926535897931 3.1415926535897931 3.1415926535897931 3.1415926535897931 3.1415926535897931 3.1415926535897931])
In [17]: np.arctan2(np.arange(10), 2**63 + 1)
Out[17]:
array([0.00000000e+00, 1.08420217e-19, 2.16840434e-19, 3.25260652e-19,
4.33680869e-19, 5.42101086e-19, 6.50521303e-19, 7.58941521e-19,
8.67361738e-19, 9.75781955e-19])
In [18]: np.arctan2(2**63 + 1, np.arange(10))
Out[18]:
array([1.57079633, 1.57079633, 1.57079633, 1.57079633, 1.57079633,
1.57079633, 1.57079633, 1.57079633, 1.57079633, 1.57079633])
In [19]: ak.arctan2(2**63 + 1, ak.arange(10))
Out[19]: array([-1.5707963267948966 -1.5707963267948966 -1.5707963267948966 -1.5707963267948966 -1.5707963267948966 -1.5707963267948966 -1.5707963267948966 -1.5707963267948966 -1.5707963267948966 -1.5707963267948966])
stress-tess
left a comment
There was a problem hiding this comment.
A few more suggested changes on the tests. I think we should go through them line by line in ipython and make sure the output at each step looks how we expect.
Requesting changes because doing assertListEqual on float pdarrays can result in test failures. So we tend to use assertTrue(np.allclose) instead
0ac45b5 to
3cb04f0
Compare
Ethan-DeBandi99
left a comment
There was a problem hiding this comment.
One thing with the logic that I found and related testing updates.
This PR (Closes #2400) adds:
int,uint, andfloatdatatypes.Additional issues have been created to implement
wherefunctionality to these functions to more closely match numpy. (#2458 and #2461). This will allow for easy single scalar cases to be put in.