Skip to content

Commit

Permalink
Merge pull request #112 from simonsobs/koopman/issue-64
Browse files Browse the repository at this point in the history
Provide user feedback when wrapping up a scan
  • Loading branch information
BrianJKoopman authored Dec 11, 2023
2 parents e7cdfaf + 5101362 commit 504fbb7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/sorunlib/seq.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def scan(description, stop_time, width, az_drift=0, tag=None, subtype=None):
run.commands.wait_until(stop_time)
finally:
# Stop motion
print("Stopping scan.")
acu.generate_scan.stop()
resp = acu.generate_scan.wait(timeout=OP_TIMEOUT)
check_response(acu, resp)
Expand Down
1 change: 1 addition & 0 deletions src/sorunlib/smurf.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ def stream(state, tag=None, subtype=None):

else:
for smurf in run.CLIENTS['smurf']:
print(f'Turning off stream from {smurf.instance_id}.')
smurf.stream.stop()
resp = smurf.stream.wait()
check_response(smurf, resp)
10 changes: 7 additions & 3 deletions tests/test_smurf.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,11 @@ def test_take_noise(concurrent):
client.take_noise.start.assert_called_with(tag=None)


def test_stream():
smurf.stream(state='on')
@pytest.mark.parametrize("state", [("on"), ("off")])
def test_stream(state):
smurf.stream(state=state)
for client in smurf.run.CLIENTS['smurf']:
client.stream.start.assert_called_once()
if state == "on":
client.stream.start.assert_called_once()
else:
client.stream.stop.assert_called_once()

0 comments on commit 504fbb7

Please sign in to comment.