@@ -45,7 +45,7 @@ def test_posavging_fwd(posaveraging_universes):
4545 )
4646 avgd = np .empty (size )
4747 for ts in posaveraging_universes .trajectory :
48- avgd [..., ts .frame ] = ts .positions . copy ( )
48+ np . copyto ( avgd [..., ts .frame ], ts .positions )
4949
5050 assert_array_almost_equal (ref_matrix_fwd , avgd [1 , :, - 1 ], decimal = 5 )
5151
@@ -63,7 +63,7 @@ def test_posavging_bwd(posaveraging_universes):
6363 )
6464 back_avgd = np .empty (size )
6565 for ts in posaveraging_universes .trajectory [::- 1 ]:
66- back_avgd [..., 9 - ts .frame ] = ts .positions . copy ( )
66+ np . copyto ( back_avgd [..., 9 - ts .frame ], ts .positions )
6767 assert_array_almost_equal (ref_matrix_bwd , back_avgd [1 , :, - 1 ], decimal = 5 )
6868
6969
@@ -78,7 +78,7 @@ def test_posavging_reset(posaveraging_universes):
7878 )
7979 avgd = np .empty (size )
8080 for ts in posaveraging_universes .trajectory :
81- avgd [..., ts .frame ] = ts .positions . copy ( )
81+ np . copyto ( avgd [..., ts .frame ], ts .positions )
8282 after_reset = ts .positions .copy ()
8383 assert_array_almost_equal (avgd [..., 0 ], after_reset , decimal = 5 )
8484
@@ -99,7 +99,7 @@ def test_posavging_specific(posaveraging_universes):
9999 specr_avgd = np .empty (size )
100100 idx = 0
101101 for ts in posaveraging_universes .trajectory [fr_list ]:
102- specr_avgd [..., idx ] = ts .positions . copy ( )
102+ np . copyto ( specr_avgd [..., idx ], ts .positions )
103103 idx += 1
104104 assert_array_almost_equal (
105105 ref_matrix_specr , specr_avgd [1 , :, - 1 ], decimal = 5
@@ -122,7 +122,7 @@ def test_posavging_specific_noreset(posaveraging_universes_noreset):
122122 specr_avgd = np .empty (size )
123123 idx = 0
124124 for ts in posaveraging_universes_noreset .trajectory [fr_list ]:
125- specr_avgd [..., idx ] = ts .positions . copy ( )
125+ np . copyto ( specr_avgd [..., idx ], ts .positions )
126126 idx += 1
127127 assert_array_almost_equal (
128128 ref_matrix_specr , specr_avgd [1 , :, - 1 ], decimal = 5
0 commit comments