@@ -230,3 +230,163 @@ def test_invalid_shape(self, shape):
230230
231231 with pytest .raises (ValueError ):
232232 dpnp .exp (dp_array , out = dp_out )
233+
234+
235+ class TestArcsin :
236+
237+ def test_arcsin (self ):
238+ array_data = numpy .arange (10 )
239+ out = numpy .empty (10 , dtype = numpy .float64 )
240+
241+ # DPNP
242+ dp_array = dpnp .array (array_data , dtype = dpnp .float64 )
243+ dp_out = dpnp .array (out , dtype = dpnp .float64 )
244+ result = dpnp .arcsin (dp_array , out = dp_out )
245+
246+ # original
247+ np_array = numpy .array (array_data , dtype = numpy .float64 )
248+ expected = numpy .arcsin (np_array , out = out )
249+
250+ numpy .testing .assert_array_equal (expected , result )
251+
252+ @pytest .mark .parametrize ("dtype" ,
253+ [numpy .float32 , numpy .int64 , numpy .int32 ],
254+ ids = ['numpy.float32' , 'numpy.int64' , 'numpy.int32' ])
255+ def test_invalid_dtype (self , dtype ):
256+
257+ dp_array = dpnp .arange (10 , dtype = dpnp .float64 )
258+ dp_out = dpnp .empty (10 , dtype = dtype )
259+
260+ with pytest .raises (ValueError ):
261+ dpnp .arcsin (dp_array , out = dp_out )
262+
263+ @pytest .mark .parametrize ("shape" ,
264+ [(0 ,), (15 , ), (2 ,2 )],
265+ ids = ['(0,)' , '(15, )' , '(2,2)' ])
266+ def test_invalid_shape (self , shape ):
267+
268+ dp_array = dpnp .arange (10 , dtype = dpnp .float64 )
269+ dp_out = dpnp .empty (shape , dtype = dpnp .float64 )
270+
271+ with pytest .raises (ValueError ):
272+ dpnp .arcsin (dp_array , out = dp_out )
273+
274+
275+ class TestArctan :
276+
277+ def test_arctan (self ):
278+ array_data = numpy .arange (10 )
279+ out = numpy .empty (10 , dtype = numpy .float64 )
280+
281+ # DPNP
282+ dp_array = dpnp .array (array_data , dtype = dpnp .float64 )
283+ dp_out = dpnp .array (out , dtype = dpnp .float64 )
284+ result = dpnp .arctan (dp_array , out = dp_out )
285+
286+ # original
287+ np_array = numpy .array (array_data , dtype = numpy .float64 )
288+ expected = numpy .arctan (np_array , out = out )
289+
290+ numpy .testing .assert_array_equal (expected , result )
291+
292+ @pytest .mark .parametrize ("dtype" ,
293+ [numpy .float32 , numpy .int64 , numpy .int32 ],
294+ ids = ['numpy.float32' , 'numpy.int64' , 'numpy.int32' ])
295+ def test_invalid_dtype (self , dtype ):
296+
297+ dp_array = dpnp .arange (10 , dtype = dpnp .float64 )
298+ dp_out = dpnp .empty (10 , dtype = dtype )
299+
300+ with pytest .raises (ValueError ):
301+ dpnp .arctan (dp_array , out = dp_out )
302+
303+ @pytest .mark .parametrize ("shape" ,
304+ [(0 ,), (15 , ), (2 ,2 )],
305+ ids = ['(0,)' , '(15, )' , '(2,2)' ])
306+ def test_invalid_shape (self , shape ):
307+
308+ dp_array = dpnp .arange (10 , dtype = dpnp .float64 )
309+ dp_out = dpnp .empty (shape , dtype = dpnp .float64 )
310+
311+ with pytest .raises (ValueError ):
312+ dpnp .arctan (dp_array , out = dp_out )
313+
314+
315+ class TestTan :
316+
317+ def test_tan (self ):
318+ array_data = numpy .arange (10 )
319+ out = numpy .empty (10 , dtype = numpy .float64 )
320+
321+ # DPNP
322+ dp_array = dpnp .array (array_data , dtype = dpnp .float64 )
323+ dp_out = dpnp .array (out , dtype = dpnp .float64 )
324+ result = dpnp .tan (dp_array , out = dp_out )
325+
326+ # original
327+ np_array = numpy .array (array_data , dtype = numpy .float64 )
328+ expected = numpy .tan (np_array , out = out )
329+
330+ numpy .testing .assert_array_equal (expected , result )
331+
332+ @pytest .mark .parametrize ("dtype" ,
333+ [numpy .float32 , numpy .int64 , numpy .int32 ],
334+ ids = ['numpy.float32' , 'numpy.int64' , 'numpy.int32' ])
335+ def test_invalid_dtype (self , dtype ):
336+
337+ dp_array = dpnp .arange (10 , dtype = dpnp .float64 )
338+ dp_out = dpnp .empty (10 , dtype = dtype )
339+
340+ with pytest .raises (ValueError ):
341+ dpnp .tan (dp_array , out = dp_out )
342+
343+ @pytest .mark .parametrize ("shape" ,
344+ [(0 ,), (15 , ), (2 ,2 )],
345+ ids = ['(0,)' , '(15, )' , '(2,2)' ])
346+ def test_invalid_shape (self , shape ):
347+
348+ dp_array = dpnp .arange (10 , dtype = dpnp .float64 )
349+ dp_out = dpnp .empty (shape , dtype = dpnp .float64 )
350+
351+ with pytest .raises (ValueError ):
352+ dpnp .tan (dp_array , out = dp_out )
353+
354+
355+ class TestArctan2 :
356+
357+ def test_arctan2 (self ):
358+ array_data = numpy .arange (10 )
359+ out = numpy .empty (10 , dtype = numpy .float64 )
360+
361+ # DPNP
362+ dp_array = dpnp .array (array_data , dtype = dpnp .float64 )
363+ dp_out = dpnp .array (out , dtype = dpnp .float64 )
364+ result = dpnp .arctan2 (dp_array , dp_array , out = dp_out )
365+
366+ # original
367+ np_array = numpy .array (array_data , dtype = numpy .float64 )
368+ expected = numpy .arctan2 (np_array , np_array , out = out )
369+
370+ numpy .testing .assert_array_equal (expected , result )
371+
372+ @pytest .mark .parametrize ("dtype" ,
373+ [numpy .float32 , numpy .int64 , numpy .int32 ],
374+ ids = ['numpy.float32' , 'numpy.int64' , 'numpy.int32' ])
375+ def test_invalid_dtype (self , dtype ):
376+
377+ dp_array = dpnp .arange (10 , dtype = dpnp .float64 )
378+ dp_out = dpnp .empty (10 , dtype = dtype )
379+
380+ with pytest .raises (ValueError ):
381+ dpnp .arctan2 (dp_array , dp_array , out = dp_out )
382+
383+ @pytest .mark .parametrize ("shape" ,
384+ [(0 ,), (15 , ), (2 ,2 )],
385+ ids = ['(0,)' , '(15, )' , '(2,2)' ])
386+ def test_invalid_shape (self , shape ):
387+
388+ dp_array = dpnp .arange (10 , dtype = dpnp .float64 )
389+ dp_out = dpnp .empty (shape , dtype = dpnp .float64 )
390+
391+ with pytest .raises (ValueError ):
392+ dpnp .arctan2 (dp_array , dp_array , out = dp_out )
0 commit comments