ivy icon indicating copy to clipboard operation
ivy copied to clipboard

Add jax.numpy.nanpercentile with tests

Open sashank17 opened this issue 2 years ago • 4 comments

Close #17054

sashank17 avatar Jun 17 '23 18:06 sashank17

Close #17054

sashank17 avatar Jun 17 '23 18:06 sashank17

I'm not sure why the tests are failing. It would be great if someone could help. Thanks!

sashank17 avatar Jun 17 '23 18:06 sashank17

@sashank17 I'm running a few tests in a codespace manually as it doesn't seem like the intelligent-tests-pr has picked up on your test functions. However, I am not quite sure what the issue is as the error logs aren't too conclusive. There are some instances where the error has arised from IndexError: Dimension out of range (expected to be in range of [-1, 0], but got 1) due to swapaxes so it may be wise to start resolving it from there.

I would recommend making a small python file that tries to the function you have writte, nanpercentile, and start with some simple cases first to give a quick sanity check that the underlying logic is correct. Then, it would be a good idea to start exploring more complex edge cases to identify what the issue is.

Let me know if you have any thoughts about this matter and I'll try my best to aid you! 😄

Ookamice avatar Jun 19 '23 10:06 Ookamice

okay thank you! I will try to do that and get back to you asap @Ookamice

sashank17 avatar Jun 19 '23 12:06 sashank17

@Ookamice I made some changes but the test still fail. I think the error is due to the fact that I don't account for axis greater than 1 in the code. The easiest way to fix this I feel is if someone implements the apply_along_axis function in ivy API. It would also make it a lot easier if percentile/nanquantile was implemented in ivy API

sashank17 avatar Jun 24 '23 15:06 sashank17

@sashank17 It's true that some composite functions require more work than others due to missing functionality in the Ivy API. If you believe Ivy's API is lacking in functionality that will help you and other future coders, feel free to follow the contributor's guide on opening an issue regarding "missing function suggestion"

Ookamice avatar Jun 26 '23 08:06 Ookamice

This PR has been labelled as stale because it has been inactive for more than 7 days. If you would like to continue working on this PR, then please add another comment or this PR will be closed in 7 days.

ivy-seed avatar Jul 04 '23 05:07 ivy-seed