Apply suggestions from code review of branch backlash-in-stage
Co-authored-by: Joe Knapper <joe.knapper@glasgow.ac.uk>
This commit is contained in:
parent
9ab7e50773
commit
d4fbcb6d61
3 changed files with 6 additions and 2 deletions
|
|
@ -36,6 +36,10 @@ class RedefinedBaseMovementError(RuntimeError):
|
||||||
class BacklashCompensation(enum.Enum):
|
class BacklashCompensation(enum.Enum):
|
||||||
"""The axes to apply backlash compensation to.
|
"""The axes to apply backlash compensation to.
|
||||||
|
|
||||||
|
This will perform a correction step - if necessary - on every
|
||||||
|
chosen axis, even if that axis position isn't set to move in
|
||||||
|
the calling movement
|
||||||
|
|
||||||
* MOVEMENT_AXES - Only the axes that are moving.
|
* MOVEMENT_AXES - Only the axes that are moving.
|
||||||
* ALL_AXES - All axes
|
* ALL_AXES - All axes
|
||||||
* XY_ONLY - Only the x and y axes.
|
* XY_ONLY - Only the x and y axes.
|
||||||
|
|
|
||||||
|
|
@ -554,7 +554,7 @@ def test_backlash_compensated_moves(test_case, dummy_stage, mocker):
|
||||||
dummy_stage._hardware_position = dummy_stage._apply_axis_direction(
|
dummy_stage._hardware_position = dummy_stage._apply_axis_direction(
|
||||||
test_case.position
|
test_case.position
|
||||||
)
|
)
|
||||||
# double check position is set
|
# check position is set
|
||||||
assert dummy_stage.position == test_case.position
|
assert dummy_stage.position == test_case.position
|
||||||
|
|
||||||
dummy_stage._backlash_state = test_case.backlash_state
|
dummy_stage._backlash_state = test_case.backlash_state
|
||||||
|
|
|
||||||
|
|
@ -487,7 +487,7 @@ def test_move_until_edge_error(rom_thing, mocker):
|
||||||
# Error should be raised even though it is in the Try:
|
# Error should be raised even though it is in the Try:
|
||||||
with pytest.raises(RuntimeError, match="Mock"):
|
with pytest.raises(RuntimeError, match="Mock"):
|
||||||
rom_thing._move_until_edge("y", direction=-1)
|
rom_thing._move_until_edge("y", direction=-1)
|
||||||
# However the "finally" should have executed returning to the starting position
|
# However the "finally" should have executed, returning to the starting position
|
||||||
assert rom_thing._stage.move_absolute.call_count == 1
|
assert rom_thing._stage.move_absolute.call_count == 1
|
||||||
abs_move_kwargs = rom_thing._stage.move_absolute.call_args.kwargs
|
abs_move_kwargs = rom_thing._stage.move_absolute.call_args.kwargs
|
||||||
expected_abs_move_kwargs = dict(
|
expected_abs_move_kwargs = dict(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue