diff --git a/src/sorunlib/smurf.py b/src/sorunlib/smurf.py index 71adc6a..2677553 100644 --- a/src/sorunlib/smurf.py +++ b/src/sorunlib/smurf.py @@ -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. @@ -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): diff --git a/tests/test_smurf.py b/tests/test_smurf.py index 817194c..56179d1 100644 --- a/tests/test_smurf.py +++ b/tests/test_smurf.py @@ -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()) diff --git a/tests/test_wiregrid.py b/tests/test_wiregrid.py index 0566c0f..63ac2c7 100644 --- a/tests/test_wiregrid.py +++ b/tests/test_wiregrid.py @@ -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 = [ @@ -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 = [ @@ -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 = [ @@ -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 = [