@@ -268,6 +268,7 @@ def test_pipette_high_speed_motion() -> None:
268268 if top_set_axis_speed != 0 :
269269 assert abs (top_set_axis_speed ) == dummy_em_pipette_max_speed
270270
271+
271272@given (
272273 x_constraint = generate_axis_constraint (),
273274 y_constraint = generate_axis_constraint (),
@@ -284,6 +285,7 @@ async def test_plunger_devectorize(
284285 b_constraint : AxisConstraints ,
285286 c_constraint : AxisConstraints ,
286287) -> None :
288+ """Test to make sure the devectorize function can isolate an axis from the move target speed limit."""
287289 constraints : SystemConstraints [str ] = {
288290 "X" : x_constraint ,
289291 "Y" : y_constraint ,
@@ -294,11 +296,29 @@ async def test_plunger_devectorize(
294296 }
295297 manager = move_manager .MoveManager (constraints = constraints )
296298 origin = {"X" : 0 , "Y" : 0 , "Z" : 0 , "A" : 0 }
297- target = {"X" : 10 , "Y" : 10 , "Z" : 10 , "A" : 10 }
299+ target = {"X" : 10 , "Y" : 10 , "Z" : 10 , "A" : 20 }
300+ speed = 10
301+ devectorized = manager .devectorize_axes (origin , target , speed , ["A" ])
302+
303+ converged , blend_log = manager .plan_motion (
304+ origin = origin ,
305+ target_list = [devectorized ],
306+ iteration_limit = 20 ,
307+ )
308+ uv = blend_log [0 ][0 ].unit_vector
309+
310+ assert (uv ["A" ]) * devectorized .max_speed == speed
311+
312+ # make sure that if the axis isn't included it doesn't effect other axes.
313+ target = {"X" : 10 , "Y" : 10 , "Z" : 10 }
298314 speed = 10
299- all_vectored = MoveTarget .build (position = target , max_speed = speed )
300315 devectorized = manager .devectorize_axes (origin , target , speed , ["A" ])
301- assert devectorized .max_speed > all_vectored .max_speed
302- assert devectorized .max_speed == 20
303316
317+ converged , blend_log = manager .plan_motion (
318+ origin = origin ,
319+ target_list = [devectorized ],
320+ iteration_limit = 20 ,
321+ )
322+ uv = blend_log [0 ][0 ].unit_vector
304323
324+ assert devectorized .max_speed == speed
0 commit comments