From e7d7338832c34a1f0df152c719d2bcf852735a98 Mon Sep 17 00:00:00 2001 From: shireenchand Date: Fri, 24 Mar 2023 20:04:41 +0530 Subject: [PATCH 1/2] Added frontend and test for numpy nextafter --- .../floating_point_routines.py | 16 ++++++++++ .../test_floating_point_routines.py | 30 +++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/ivy/functional/frontends/numpy/mathematical_functions/floating_point_routines.py b/ivy/functional/frontends/numpy/mathematical_functions/floating_point_routines.py index e69de29bb2d1d..4020878bb17f5 100644 --- a/ivy/functional/frontends/numpy/mathematical_functions/floating_point_routines.py +++ b/ivy/functional/frontends/numpy/mathematical_functions/floating_point_routines.py @@ -0,0 +1,16 @@ +# global +import ivy + +# local +from ivy.functional.frontends.numpy.func_wrapper import ( + to_ivy_arrays_and_back, + handle_numpy_casting, + handle_numpy_dtype, + from_zero_dim_arrays_to_scalar, + handle_numpy_out, +) + + +@to_ivy_arrays_and_back +def nextafter(x1, x2, /, *, out=None): + return ivy.nextafter(x1, x2, out=out) diff --git a/ivy_tests/test_ivy/test_frontends/test_numpy/test_mathematical_functions/test_floating_point_routines.py b/ivy_tests/test_ivy/test_frontends/test_numpy/test_mathematical_functions/test_floating_point_routines.py index e69de29bb2d1d..6bbac59603cbe 100644 --- a/ivy_tests/test_ivy/test_frontends/test_numpy/test_mathematical_functions/test_floating_point_routines.py +++ b/ivy_tests/test_ivy/test_frontends/test_numpy/test_mathematical_functions/test_floating_point_routines.py @@ -0,0 +1,30 @@ +# local +import ivy_tests.test_ivy.helpers as helpers +from ivy_tests.test_ivy.helpers import handle_frontend_test + + +@handle_frontend_test( + fn_tree="numpy.nextafter", + dtype_and_x=helpers.dtype_and_values( + available_dtypes=helpers.get_dtypes("float"), + num_arrays=2 + ), +) +def test_numpy_nextafter( + dtype_and_x, + frontend, + test_flags, + fn_tree, + on_device, +): + input_dtype, x = dtype_and_x + helpers.test_frontend_function( + input_dtypes=input_dtype, + frontend=frontend, + test_flags=test_flags, + fn_tree=fn_tree, + on_device=on_device, + test_values=False, + x1=x[0], + x2=x[1] + ) From cae0350231749c9483024c6aa0c2757e7b17b4e3 Mon Sep 17 00:00:00 2001 From: shireenchand Date: Fri, 14 Apr 2023 07:08:26 +0530 Subject: [PATCH 2/2] added frontend and test for nextafter function --- .../numpy/mathematical_functions/floating_point_routines.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/ivy/functional/frontends/numpy/mathematical_functions/floating_point_routines.py b/ivy/functional/frontends/numpy/mathematical_functions/floating_point_routines.py index 4020878bb17f5..b5b61c9532469 100644 --- a/ivy/functional/frontends/numpy/mathematical_functions/floating_point_routines.py +++ b/ivy/functional/frontends/numpy/mathematical_functions/floating_point_routines.py @@ -3,11 +3,7 @@ # local from ivy.functional.frontends.numpy.func_wrapper import ( - to_ivy_arrays_and_back, - handle_numpy_casting, - handle_numpy_dtype, - from_zero_dim_arrays_to_scalar, - handle_numpy_out, + to_ivy_arrays_and_back )