Skip to content

Commit 4838825

Browse files
mikeprosserniMike Prosser
andauthored
rename waveform.unit_description to units (#815)
Co-authored-by: Mike Prosser <[email protected]>
1 parent 911b137 commit 4838825

File tree

4 files changed

+23
-25
lines changed

4 files changed

+23
-25
lines changed

examples/analog_in/voltage_acq_int_clk_wfm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@
1818
waveform = task.read_waveform()
1919
print(f"Acquired data: {waveform.scaled_data}")
2020
print(f"Channel name: {waveform.channel_name}")
21-
print(f"Unit description: {waveform.unit_description}")
21+
print(f"Units: {waveform.units}")
2222
print(f"t0: {waveform.timing.start_time}")
2323
print(f"dt: {waveform.timing.sample_interval}")

poetry.lock

Lines changed: 6 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ python-decouple = ">=3.8"
5050
click = ">=8.0.0"
5151
distro = { version = ">=1.9.0", platform = "linux" }
5252
requests = ">=2.25.0"
53-
nitypes = {version=">=0.1.0dev3", allow-prereleases=true}
53+
nitypes = {version=">=0.1.0dev9", allow-prereleases=true}
5454

5555
[tool.poetry.extras]
5656
grpc = ["grpcio", "protobuf"]

tests/component/test_stream_readers_ai.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ def test___analog_single_channel_reader___read_waveform___returns_valid_waveform
192192
assert _is_timestamp_close_to_now(waveform.timing.timestamp)
193193
assert waveform.timing.sample_interval == ht_timedelta(seconds=1 / 1000)
194194
assert waveform.channel_name == ai_single_channel_task_with_timing.ai_channels[0].name
195-
assert waveform.unit_description == "Volts"
195+
assert waveform.units == "Volts"
196196
assert waveform.sample_count == samples_to_read
197197

198198

@@ -211,7 +211,7 @@ def test___analog_single_channel_reader___read_waveform_no_args___returns_valid_
211211
assert _is_timestamp_close_to_now(waveform.timing.timestamp)
212212
assert waveform.timing.sample_interval == ht_timedelta(seconds=1 / 1000)
213213
assert waveform.channel_name == ai_single_channel_task_with_timing.ai_channels[0].name
214-
assert waveform.unit_description == "Volts"
214+
assert waveform.units == "Volts"
215215
assert waveform.sample_count == 50
216216

217217

@@ -232,7 +232,7 @@ def test___analog_single_channel_reader___read_waveform_in_place___populates_val
232232
assert _is_timestamp_close_to_now(waveform.timing.timestamp)
233233
assert waveform.timing.sample_interval == ht_timedelta(seconds=1 / 1000)
234234
assert waveform.channel_name == ai_single_channel_task_with_timing.ai_channels[0].name
235-
assert waveform.unit_description == "Volts"
235+
assert waveform.units == "Volts"
236236
assert waveform.sample_count == samples_to_read
237237

238238

@@ -300,7 +300,7 @@ def test___analog_single_channel_reader___read_waveform_high_sample_rate___retur
300300
assert _is_timestamp_close_to_now(waveform.timing.timestamp)
301301
assert waveform.timing.sample_interval == ht_timedelta(seconds=1 / 10_000_000)
302302
assert waveform.channel_name == ai_single_channel_task_with_high_rate.ai_channels[0].name
303-
assert waveform.unit_description == "Volts"
303+
assert waveform.units == "Volts"
304304
assert waveform.sample_count == samples_to_read
305305

306306

@@ -324,7 +324,7 @@ def test___analog_single_channel_reader_with_timing_flag___read_waveform___only_
324324
assert waveform.timing.sample_interval_mode == SampleIntervalMode.REGULAR
325325
assert waveform.timing.sample_interval == ht_timedelta(seconds=1 / 1000)
326326
assert waveform.channel_name == ""
327-
assert waveform.unit_description == ""
327+
assert waveform.units == ""
328328

329329

330330
@pytest.mark.grpc_skip(reason="read_analog_waveform not implemented in GRPC")
@@ -344,7 +344,7 @@ def test___analog_single_channel_reader_with_extended_properties_flag___read_wav
344344
assert waveform.scaled_data == pytest.approx(expected, abs=VOLTAGE_EPSILON)
345345
assert waveform.timing.sample_interval_mode == SampleIntervalMode.NONE
346346
assert waveform.channel_name == ai_single_channel_task_with_timing.ai_channels[0].name
347-
assert waveform.unit_description == "Volts"
347+
assert waveform.units == "Volts"
348348

349349

350350
@pytest.mark.grpc_skip(reason="read_analog_waveform not implemented in GRPC")
@@ -369,7 +369,7 @@ def test___analog_single_channel_reader_with_both_flags___read_waveform___includ
369369
assert waveform.timing.sample_interval_mode == SampleIntervalMode.REGULAR
370370
assert waveform.timing.sample_interval == ht_timedelta(seconds=1 / 1000)
371371
assert waveform.channel_name == ai_single_channel_task_with_timing.ai_channels[0].name
372-
assert waveform.unit_description == "Volts"
372+
assert waveform.units == "Volts"
373373

374374

375375
@pytest.mark.grpc_skip(reason="read_analog_waveform not implemented in GRPC")
@@ -389,7 +389,7 @@ def test___analog_single_channel_reader_with_none_flag___read_waveform___minimal
389389
assert waveform.scaled_data == pytest.approx(expected, abs=VOLTAGE_EPSILON)
390390
assert waveform.timing.sample_interval_mode == SampleIntervalMode.NONE
391391
assert waveform.channel_name == ""
392-
assert waveform.unit_description == ""
392+
assert waveform.units == ""
393393

394394

395395
def test___analog_multi_channel_reader___read_one_sample___returns_valid_samples(
@@ -484,7 +484,7 @@ def test___analog_multi_channel_reader___read_waveforms___returns_valid_waveform
484484
assert (
485485
waveform.channel_name == ai_multi_channel_task_with_timing.ai_channels[chan_index].name
486486
)
487-
assert waveform.unit_description == "Volts"
487+
assert waveform.units == "Volts"
488488
assert waveform.sample_count == samples_to_read
489489

490490

@@ -510,7 +510,7 @@ def test___analog_multi_channel_reader___read_waveforms_no_args___returns_valid_
510510
assert (
511511
waveform.channel_name == ai_multi_channel_task_with_timing.ai_channels[chan_index].name
512512
)
513-
assert waveform.unit_description == "Volts"
513+
assert waveform.units == "Volts"
514514
assert waveform.sample_count == 50
515515

516516

@@ -542,7 +542,7 @@ def test___analog_multi_channel_reader___read_waveforms_in_place___populates_val
542542
assert (
543543
waveform.channel_name == ai_multi_channel_task_with_timing.ai_channels[chan_index].name
544544
)
545-
assert waveform.unit_description == "Volts"
545+
assert waveform.units == "Volts"
546546
assert waveform.sample_count == samples_to_read
547547

548548

@@ -607,7 +607,7 @@ def test___analog_multi_channel_reader_with_timing_flag___read_waveforms___only_
607607
assert waveform.timing.sample_interval_mode == SampleIntervalMode.REGULAR
608608
assert waveform.timing.sample_interval == ht_timedelta(seconds=1 / 1000)
609609
assert waveform.channel_name == ""
610-
assert waveform.unit_description == ""
610+
assert waveform.units == ""
611611
assert waveform.sample_count == samples_to_read
612612

613613

@@ -634,7 +634,7 @@ def test___analog_multi_channel_reader_with_extended_properties_flag___read_wave
634634
assert (
635635
waveform.channel_name == ai_multi_channel_task_with_timing.ai_channels[chan_index].name
636636
)
637-
assert waveform.unit_description == "Volts"
637+
assert waveform.units == "Volts"
638638
assert waveform.sample_count == samples_to_read
639639

640640

@@ -666,7 +666,7 @@ def test___analog_multi_channel_reader_with_both_flags___read_waveforms___includ
666666
assert (
667667
waveform.channel_name == ai_multi_channel_task_with_timing.ai_channels[chan_index].name
668668
)
669-
assert waveform.unit_description == "Volts"
669+
assert waveform.units == "Volts"
670670
assert waveform.sample_count == samples_to_read
671671

672672

@@ -691,7 +691,7 @@ def test___analog_multi_channel_reader_with_none_flag___read_waveforms___minimal
691691
assert waveform.scaled_data == pytest.approx(expected, abs=VOLTAGE_EPSILON)
692692
assert waveform.timing.sample_interval_mode == SampleIntervalMode.NONE
693693
assert waveform.channel_name == ""
694-
assert waveform.unit_description == ""
694+
assert waveform.units == ""
695695
assert waveform.sample_count == samples_to_read
696696

697697

0 commit comments

Comments
 (0)