-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1183 from ZLLentz/fix_att_move_err
ENH: for LCLS-I att, give proper error for uninterruptable move
- Loading branch information
Showing
5 changed files
with
193 additions
and
4 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
docs/source/upcoming_release_notes/1183-fix_att_move_err.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
1183 fix_att_move_err | ||
##################### | ||
|
||
API Breaks | ||
---------- | ||
- N/A | ||
|
||
Features | ||
-------- | ||
- Added `PVPositionerNoInterrupt`, a pv positioner base class whose moves | ||
cannot be interrupted (and will loudly complain about any such attempts). | ||
|
||
Device Updates | ||
-------------- | ||
- N/A | ||
|
||
New Devices | ||
----------- | ||
- N/A | ||
|
||
Bugfixes | ||
-------- | ||
- LCLSI attenuator classes (generated from the `Attenuator` factory function) | ||
will now raise a much clearer error for when they cannot interrupt a | ||
previous move, without trying (and failing) to interrupt the previous move. | ||
|
||
Maintenance | ||
----------- | ||
- N/A | ||
|
||
Contributors | ||
------------ | ||
- zllentz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import pytest | ||
from ophyd.device import Component as Cpt | ||
from ophyd.signal import Signal | ||
|
||
from pcdsdevices.pv_positioner import PVPositionerNoInterrupt | ||
|
||
|
||
class PVPositionerNoInterruptLocal(PVPositionerNoInterrupt): | ||
setpoint = Cpt(Signal) | ||
done = Cpt(Signal) | ||
|
||
|
||
@pytest.fixture(scope="function") | ||
def pvpos_no(request): | ||
return PVPositionerNoInterruptLocal(name=request.node.name) | ||
|
||
|
||
def test_pvpos_no_motion(pvpos_no): | ||
pvpos_no.done.put(1) | ||
status = pvpos_no.move(100, wait=False) | ||
# This is kind of silly but let's sim the full move | ||
pvpos_no.done.put(0) | ||
pvpos_no.done.put(1) | ||
assert pvpos_no.setpoint.get() == 100 | ||
status.wait(timeout=1.0) | ||
assert status.done | ||
assert status.success | ||
|
||
|
||
def test_pvpos_no_interrupt(pvpos_no): | ||
# Already moving, can't start a new one | ||
pvpos_no.done.put(0) | ||
with pytest.raises(RuntimeError): | ||
pvpos_no.move(100, wait=False) |