Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_reset(session):
default_output_mode = session.output_mode
assert default_output_mode == nifgen.OutputMode.ARB
session.output_mode = nifgen.OutputMode.SEQ
assert session.output_mode == nifgen.OutputMode.SEQ
session.reset()
assert session.output_mode == nifgen.OutputMode.ARB
def test_reset(session):
default_output_mode = session.output_mode
assert default_output_mode == nifgen.OutputMode.ARB
session.output_mode = nifgen.OutputMode.SEQ
assert session.output_mode == nifgen.OutputMode.SEQ
session.reset()
assert session.output_mode == nifgen.OutputMode.ARB
def test_configure_arb_waveform(session):
waveform_data = [x * (1.0 / 256.0) for x in range(256)]
session.output_mode = nifgen.OutputMode.ARB
session.configure_arb_waveform(session.create_waveform(waveform_data), 1.0, 0.0)
def example(resource_name, options, samples, gain, offset, gen_time):
waveform_data = create_waveform_data(samples)
with nifgen.Session(resource_name=resource_name, options=options) as session:
session.output_mode = nifgen.OutputMode.ARB
waveform = session.create_waveform(waveform_data_array=waveform_data)
session.configure_arb_waveform(waveform_handle=waveform, gain=gain, offset=offset)
with session.initiate():
time.sleep(gen_time)