@@ -367,10 +367,8 @@ def test_dot_vectors():
367367 ],
368368)
369369def test_dot_matrices (out ):
370- a = np .arange (9 ) * cm
371- a .shape = (3 , 3 )
372- b = np .arange (9 ) * s
373- b .shape = (3 , 3 )
370+ a = np .reshape (np .arange (9 ), (3 , 3 )) * cm
371+ b = np .reshape (np .arange (9 ), (3 , 3 )) * s
374372
375373 res = np .dot (a , b , out = out )
376374
@@ -422,10 +420,8 @@ def test_dot_mixed_ndarray_unyt_array():
422420
423421
424422def test_invalid_dot_matrices ():
425- a = np .arange (9 ) * cm
426- a .shape = (3 , 3 )
427- b = np .arange (9 ) * s
428- b .shape = (3 , 3 )
423+ a = np .reshape (np .arange (9 ), (3 , 3 ))
424+ b = np .reshape (np .arange (9 ), (3 , 3 )) * s
429425
430426 out = np .empty ((3 , 3 ), dtype = np .int_ , order = "C" ) * s ** 2
431427 res = np .dot (a , b , out = out )
@@ -473,8 +469,7 @@ def test_linalg_inv():
473469
474470
475471def test_linalg_tensorinv ():
476- a = np .eye (4 * 6 ) * cm
477- a .shape = (4 , 6 , 8 , 3 )
472+ a = np .reshape (np .eye (4 * 6 ), (4 , 6 , 8 , 3 )) * cm
478473 ia = np .linalg .tensorinv (a )
479474 assert 1 * ia .units == 1 / cm
480475
0 commit comments