Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/sorunlib/smurf.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,14 @@ def set_targets(targets):
run.CLIENTS['smurf'] = _smurf_clients


def bias_step(tag=None, concurrent=True, settling_time=None):
def bias_step(tag=None, bias_step_kwargs=None, concurrent=True, settling_time=None):
"""Perform a bias step on all SMuRF Controllers.

Args:
tag (str, optional): Tag or comma-separated listed of tags to attach to
the operation.
bias_step_kwargs (dict, optional): Additional keyword arguments to pass to
``take_bias_steps``.
concurrent (bool, optional): A bool which determines how the operation
is run across the active SMuRF controllers. It runs in parallel if
True, and in series if False.
Expand All @@ -137,7 +139,8 @@ def bias_step(tag=None, concurrent=True, settling_time=None):
_run_op('take_bias_steps',
concurrent=concurrent,
settling_time=settling_time,
tag=tag)
tag=tag,
kwargs=bias_step_kwargs)


def iv_curve(tag=None, iv_kwargs=None, concurrent=True, settling_time=None):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_smurf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def test_set_targets():
def test_bias_step(concurrent):
smurf.bias_step(concurrent=concurrent, settling_time=10)
for client in smurf.run.CLIENTS['smurf']:
client.take_bias_steps.start.assert_called_with(tag=None)
client.take_bias_steps.start.assert_called_with(tag=None, kwargs=None)


@patch('sorunlib.smurf.time.sleep', MagicMock())
Expand Down
34 changes: 17 additions & 17 deletions tests/test_wiregrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,10 @@ def test_calibrate_stepwise_with_biasstep(
# All other internal functions tested separately, just make sure smurf
# stream is run
expected_calls_of_bias_steps = [
call(tag=f'wiregrid, wg_before_wo_wg{el_tag}'),
call(tag=f'wiregrid, wg_before_wt_wg{el_tag}'),
call(tag=f'wiregrid, wg_after_wt_wg{el_tag}'),
call(tag=f'wiregrid, wg_after_wo_wg{el_tag}')
call(tag=f'wiregrid, wg_before_wo_wg{el_tag}', kwargs=None),
call(tag=f'wiregrid, wg_before_wt_wg{el_tag}', kwargs=None),
call(tag=f'wiregrid, wg_after_wt_wg{el_tag}', kwargs=None),
call(tag=f'wiregrid, wg_after_wo_wg{el_tag}', kwargs=None)
]

expected_tags_of_streams = [
Expand Down Expand Up @@ -376,10 +376,10 @@ def test_time_constant_cw():
# just make sure bias_steps and streams because other functions are already
# tested separately.
expected_calls_of_bias_steps = [
call(tag='wiregrid, wg_time_constant, wg_ejected, hwp_cw'),
call(tag='wiregrid, wg_time_constant, wg_inserted, hwp_cw'),
call(tag='wiregrid, wg_time_constant, wg_inserted, hwp_ccw'),
call(tag='wiregrid, wg_time_constant, wg_ejected, hwp_ccw')
call(tag='wiregrid, wg_time_constant, wg_ejected, hwp_cw', kwargs=None),
call(tag='wiregrid, wg_time_constant, wg_inserted, hwp_cw', kwargs=None),
call(tag='wiregrid, wg_time_constant, wg_inserted, hwp_ccw', kwargs=None),
call(tag='wiregrid, wg_time_constant, wg_ejected, hwp_ccw', kwargs=None)
]

expected_tags_of_streams = [
Expand Down Expand Up @@ -421,10 +421,10 @@ def test_time_constant_ccw_el90():
# just make sure bias_steps and streams because other functions are already
# tested separately.
expected_calls_of_bias_steps = [
call(tag='wiregrid, wg_time_constant, wg_ejected, hwp_ccw, wg_el90'),
call(tag='wiregrid, wg_time_constant, wg_inserted, hwp_ccw, wg_el90'),
call(tag='wiregrid, wg_time_constant, wg_inserted, hwp_cw, wg_el90'),
call(tag='wiregrid, wg_time_constant, wg_ejected, hwp_cw, wg_el90')
call(tag='wiregrid, wg_time_constant, wg_ejected, hwp_ccw, wg_el90', kwargs=None),
call(tag='wiregrid, wg_time_constant, wg_inserted, hwp_ccw, wg_el90', kwargs=None),
call(tag='wiregrid, wg_time_constant, wg_inserted, hwp_cw, wg_el90', kwargs=None),
call(tag='wiregrid, wg_time_constant, wg_ejected, hwp_cw, wg_el90', kwargs=None)
]

expected_tags_of_streams = [
Expand Down Expand Up @@ -466,11 +466,11 @@ def test_time_constant_repeats():
# just make sure bias_steps and streams because other functions are already
# tested separately.
expected_calls_of_bias_steps = [
call(tag='wiregrid, wg_time_constant, wg_ejected, hwp_cw'),
call(tag='wiregrid, wg_time_constant, wg_inserted, hwp_cw'),
call(tag='wiregrid, wg_time_constant, wg_inserted, hwp_ccw'),
call(tag='wiregrid, wg_time_constant, wg_inserted, hwp_cw'),
call(tag='wiregrid, wg_time_constant, wg_ejected, hwp_cw')
call(tag='wiregrid, wg_time_constant, wg_ejected, hwp_cw', kwargs=None),
call(tag='wiregrid, wg_time_constant, wg_inserted, hwp_cw', kwargs=None),
call(tag='wiregrid, wg_time_constant, wg_inserted, hwp_ccw', kwargs=None),
call(tag='wiregrid, wg_time_constant, wg_inserted, hwp_cw', kwargs=None),
call(tag='wiregrid, wg_time_constant, wg_ejected, hwp_cw', kwargs=None)
]

expected_tags_of_streams = [
Expand Down