@@ -280,8 +280,8 @@ def test_point_infered_np(
280280 shape : Shape ,
281281):
282282 if xnp is not None : # Normalize np arrays to test the various backend
283- x = xnp .array (x )
284- y = xnp .array (y )
283+ x = xnp .asarray (x )
284+ y = xnp .asarray (y )
285285 else :
286286 xnp = np
287287
@@ -565,7 +565,7 @@ def test_broadcast(xnp: enp.NpModule):
565565 p = Nested (
566566 # pt.shape broadcasted to (2, 3)
567567 pt = Point (
568- x = xnp .array (0 ),
568+ x = xnp .asarray (0 ),
569569 y = xnp .zeros (broadcast_shape + (3 ,)),
570570 ),
571571 # iso.shape == (), broadcasted to (2, 3)
@@ -642,13 +642,13 @@ class PointNoCast(dca.DataclassArray):
642642
643643 with pytest .raises (ValueError , match = 'Cannot cast float16' ):
644644 PointNoCast (
645- x = xnp .array ([1 , 2 , 3 ], dtype = np .float16 ),
646- y = xnp .array ([1 , 2 , 3 ], dtype = np .float16 ),
645+ x = xnp .asarray ([1 , 2 , 3 ], dtype = np .float16 ),
646+ y = xnp .asarray ([1 , 2 , 3 ], dtype = np .float16 ),
647647 )
648648
649649 p = PointNoCast (
650- x = xnp .array ([1 , 2 , 3 ], dtype = np .float16 ),
651- y = xnp .array ([1 , 2 , 3 ], dtype = np .uint8 ),
650+ x = xnp .asarray ([1 , 2 , 3 ], dtype = np .float16 ),
651+ y = xnp .asarray ([1 , 2 , 3 ], dtype = np .uint8 ),
652652 )
653653 assert p .shape == (3 ,)
654654 assert enp .lazy .as_dtype (p .x .dtype ) == np .float16
@@ -665,7 +665,7 @@ class PointNoList(dca.DataclassArray):
665665
666666 with pytest .raises (TypeError , match = 'Could not infer numpy module' ):
667667 PointNoList (
668- x = xnp .array (1 , dtype = np .float16 ),
668+ x = xnp .asarray (1 , dtype = np .float16 ),
669669 y = [1 , 2 , 3 ],
670670 )
671671
@@ -679,8 +679,8 @@ class PointNoBroadcast(dca.DataclassArray):
679679
680680 with pytest .raises (ValueError , match = 'Cannot broadcast' ):
681681 PointNoBroadcast (
682- x = xnp .array (1 , dtype = np .float16 ),
683- y = xnp .array ([1 , 2 , 3 ], dtype = np .int32 ),
682+ x = xnp .asarray (1 , dtype = np .float16 ),
683+ y = xnp .asarray ([1 , 2 , 3 ], dtype = np .int32 ),
684684 )
685685
686686
0 commit comments