@@ -65,70 +65,58 @@ def listize(x):
6565@pytest .mark .parametrize ("x_start" , listize ((np .random .rand () - 0.5 ) * 1000 ))
6666@pytest .mark .parametrize ("x_tiles" , listize (np .random .randint (0 , 5 )))
6767@pytest .mark .parametrize ("x_length" , listize (np .random .rand () * 1000 ))
68- @pytest .mark .parametrize ("x_overlap" , listize (np .random .rand ()))
6968@pytest .mark .parametrize ("y_start" , listize (((np .random .rand () - 0.5 ) * 1000 )))
7069@pytest .mark .parametrize ("y_tiles" , listize (np .random .randint (0 , 5 )))
7170@pytest .mark .parametrize ("y_length" , listize (np .random .rand () * 1000 ))
72- @pytest .mark .parametrize ("y_overlap" , listize (np .random .rand ()))
7371@pytest .mark .parametrize ("z_start" , listize (((np .random .rand () - 0.5 ) * 1000 )))
7472@pytest .mark .parametrize ("z_tiles" , listize (np .random .randint (0 , 5 )))
7573@pytest .mark .parametrize ("z_length" , listize (np .random .rand () * 1000 ))
76- @pytest .mark .parametrize ("z_overlap" , listize (np .random .rand ()))
7774@pytest .mark .parametrize ("theta_start" , listize (((np .random .rand () - 0.5 ) * 180 )))
7875@pytest .mark .parametrize ("theta_tiles" , listize (np .random .randint (0 , 5 )))
7976@pytest .mark .parametrize ("theta_length" , listize ((np .random .rand () * 5 )))
80- @pytest .mark .parametrize ("theta_overlap" , listize (np .random .rand ()))
8177@pytest .mark .parametrize ("f_start" , listize (((np .random .rand () - 0.5 ) * 1000 )))
8278@pytest .mark .parametrize ("f_tiles" , listize (np .random .randint (0 , 5 )))
8379@pytest .mark .parametrize ("f_length" , listize (np .random .rand () * 1000 ))
84- @pytest .mark .parametrize ("f_overlap " , listize (np .random .rand ()))
80+ @pytest .mark .parametrize ("overlap " , listize (np .random .rand ()))
8581@pytest .mark .parametrize ("f_track_with_z" , [True , False ])
8682def test_compute_tiles_from_bounding_box (
8783 x_start ,
8884 x_tiles ,
8985 x_length ,
90- x_overlap ,
9186 y_start ,
9287 y_tiles ,
9388 y_length ,
94- y_overlap ,
9589 z_start ,
9690 z_tiles ,
9791 z_length ,
98- z_overlap ,
9992 theta_start ,
10093 theta_tiles ,
10194 theta_length ,
102- theta_overlap ,
10395 f_start ,
10496 f_tiles ,
10597 f_length ,
106- f_overlap ,
98+ overlap ,
10799 f_track_with_z ,
108100):
109101 from navigate .tools .multipos_table_tools import compute_tiles_from_bounding_box
110102
111- tiles = compute_tiles_from_bounding_box (
103+ axes , tiles = compute_tiles_from_bounding_box (
112104 x_start ,
113105 x_tiles ,
114106 x_length ,
115- x_overlap ,
116107 y_start ,
117108 y_tiles ,
118109 y_length ,
119- y_overlap ,
120110 z_start ,
121111 z_tiles ,
122112 z_length ,
123- z_overlap ,
124113 theta_start ,
125114 theta_tiles ,
126115 theta_length ,
127- theta_overlap ,
128116 f_start ,
129117 f_tiles ,
130118 f_length ,
131- f_overlap ,
119+ overlap ,
132120 f_track_with_z ,
133121 )
134122
@@ -138,11 +126,11 @@ def test_compute_tiles_from_bounding_box(
138126 theta_tiles = 1 if theta_tiles <= 0 else theta_tiles
139127 f_tiles = 1 if f_tiles <= 0 else f_tiles
140128
141- x_max = x_start + (1 - x_overlap ) * x_length * (x_tiles - 1 )
142- y_max = y_start + (1 - y_overlap ) * y_length * (y_tiles - 1 )
143- z_max = z_start + (1 - z_overlap ) * z_length * (z_tiles - 1 )
144- theta_max = theta_start + (1 - theta_overlap ) * theta_length * (theta_tiles - 1 )
145- f_max = f_start + (1 - f_overlap ) * f_length * (f_tiles - 1 )
129+ x_max = x_start + (1 - overlap ) * x_length * (x_tiles - 1 )
130+ y_max = y_start + (1 - overlap ) * y_length * (y_tiles - 1 )
131+ z_max = z_start + (1 - overlap ) * z_length * (z_tiles - 1 )
132+ theta_max = theta_start + (1 - overlap ) * theta_length * (theta_tiles - 1 )
133+ f_max = f_start + (1 - overlap ) * f_length * (f_tiles - 1 )
146134
147135 # check extrema
148136 assert tiles [0 , 0 ] == x_start
@@ -213,19 +201,19 @@ def tearDown(self) -> None:
213201 def test_update_table_1 (self ):
214202 pos = np .array ([[1 , 2 , 3 , 4 , 5 ], [6 , 7 , 8 , 9 , 10 ], [11 , 12 , 13 , 14 , 15 ]])
215203
216- update_table (table = self .table , pos = pos , append = False )
204+ update_table (table = self .table , pos = pos , axes = [ "X" , "Y" , "Z" , "THETA" , "F" ], append = False )
217205
218206 np .testing .assert_array_equal (self .table .model .df ["X" ], pos [:, 0 ])
219207 np .testing .assert_array_equal (self .table .model .df ["Y" ], pos [:, 1 ])
220208 np .testing .assert_array_equal (self .table .model .df ["Z" ], pos [:, 2 ])
221- np .testing .assert_array_equal (self .table .model .df ["R " ], pos [:, 3 ])
209+ np .testing .assert_array_equal (self .table .model .df ["THETA " ], pos [:, 3 ])
222210 np .testing .assert_array_equal (self .table .model .df ["F" ], pos [:, 4 ])
223211 assert self .table .currentrow == 2
224212
225213 new_positions = np .array ([[16 , 17 , 18 , 19 , 20 ], [21 , 22 , 23 , 24 , 25 ]])
226214
227215 print (self .table .model .df .shape )
228- update_table (self .table , pos = new_positions , append = True )
216+ update_table (self .table , pos = new_positions , axes = [ "X" , "Y" , "Z" , "THETA" , "F" ], append = True )
229217 assert self .table .currentrow == 4
230218 np .testing .assert_array_equal (
231219 self .table .model .df ["X" ][
@@ -246,7 +234,7 @@ def test_update_table_1(self):
246234 new_positions [:, 2 ],
247235 )
248236 np .testing .assert_array_equal (
249- self .table .model .df ["R " ][
237+ self .table .model .df ["THETA " ][
250238 3 :,
251239 ],
252240 new_positions [:, 3 ],
0 commit comments