Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Digital Stream Writer tests #531

Merged
merged 3 commits into from
Mar 6, 2024
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
4 changes: 2 additions & 2 deletions tests/component/test_stream_readers_di.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def di_single_channel_multi_line_task(
task: nidaqmx.Task, sim_6363_device: nidaqmx.system.Device
) -> nidaqmx.Task:
task.di_channels.add_di_chan(
flatten_channel_string(sim_6363_device.di_lines[:8].name),
flatten_channel_string(sim_6363_device.di_lines.channel_names[:8]),
line_grouping=LineGrouping.CHAN_FOR_ALL_LINES,
)
return task
Expand All @@ -39,7 +39,7 @@ def di_multi_channel_multi_line_task(
task: nidaqmx.Task, sim_6363_device: nidaqmx.system.Device
) -> nidaqmx.Task:
task.di_channels.add_di_chan(
flatten_channel_string(sim_6363_device.di_lines[:8].name),
flatten_channel_string(sim_6363_device.di_lines.channel_names[:8]),
line_grouping=LineGrouping.CHAN_PER_LINE,
)
return task
Expand Down
12 changes: 6 additions & 6 deletions tests/component/test_stream_writers_ao.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def ao_multi_channel_task(
task.start()

# set the output to a known initial value
task.write([0.0 for _ in range(num_chans)])
task.write([0.0] * num_chans)

return task

Expand Down Expand Up @@ -201,7 +201,7 @@ def test___analog_multi_channel_writer___write_many_sample___updates_output(
data = numpy.ascontiguousarray(
numpy.transpose(
numpy.linspace(
[0.0 for _ in range(num_channels)],
[0.0] * num_channels,
expected,
num=samples_to_write,
dtype=numpy.float64,
Expand Down Expand Up @@ -241,7 +241,7 @@ def test___analog_unscaled_writer___write_int16___updates_output(
data = numpy.ascontiguousarray(
numpy.transpose(
numpy.linspace(
[0 for _ in range(num_channels)],
[0] * num_channels,
[_volts_to_codes(v) for v in expected],
num=samples_to_write,
dtype=numpy.int16,
Expand Down Expand Up @@ -283,7 +283,7 @@ def test___analog_unscaled_writer___write_int32___updates_output(
data = numpy.ascontiguousarray(
numpy.transpose(
numpy.linspace(
[0 for _ in range(num_channels)],
[0] * num_channels,
[_volts_to_codes(v) for v in expected],
num=samples_to_write,
dtype=numpy.int32,
Expand Down Expand Up @@ -325,7 +325,7 @@ def test___analog_unscaled_writer___write_uint16___updates_output(
data = numpy.ascontiguousarray(
numpy.transpose(
numpy.linspace(
[0 for _ in range(num_channels)],
[0] * num_channels,
[_volts_to_codes(v) for v in expected],
num=samples_to_write,
dtype=numpy.uint16,
Expand Down Expand Up @@ -367,7 +367,7 @@ def test___analog_unscaled_writer___write_uint32___updates_output(
data = numpy.ascontiguousarray(
numpy.transpose(
numpy.linspace(
[0 for _ in range(num_channels)],
[0] * num_channels,
[_volts_to_codes(v) for v in expected],
num=samples_to_write,
dtype=numpy.uint32,
Expand Down
Loading
Loading