Skip to content

Commit 922dce2

Browse files
mikeprosserniMike Prosser
andauthored
Use the new waveform.start_index instead of _start_index (#827)
* use the new waveform.start_index * try an explicit typing_extensions dependency --------- Co-authored-by: Mike Prosser <[email protected]>
1 parent 4c1f0e4 commit 922dce2

10 files changed

+30
-30
lines changed

generated/nidaqmx/stream_readers/_analog_multi_channel_reader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,12 @@ def read_waveforms(
214214
DAQmxErrors.MISMATCHED_INPUT_ARRAY_SIZES, task_name=self._task.name)
215215

216216
for i, waveform in enumerate(waveforms):
217-
if waveform._start_index + number_of_samples_per_channel > waveform.capacity:
217+
if waveform.start_index + number_of_samples_per_channel > waveform.capacity:
218218
if reallocation_policy == ReallocationPolicy.TO_GROW:
219-
waveform.capacity = waveform._start_index + number_of_samples_per_channel
219+
waveform.capacity = waveform.start_index + number_of_samples_per_channel
220220
else:
221221
raise DaqError(
222-
f'The waveform at index {i} does not have enough space ({waveform.capacity - waveform._start_index}) to hold '
222+
f'The waveform at index {i} does not have enough space ({waveform.capacity - waveform.start_index}) to hold '
223223
f'the requested number of samples ({number_of_samples_per_channel}). Please provide larger '
224224
'waveforms or adjust the number of samples requested.',
225225
DAQmxErrors.READ_BUFFER_TOO_SMALL, task_name=self._task.name)

generated/nidaqmx/stream_readers/_analog_single_channel_reader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,12 @@ def read_waveform(
174174
self._task._calculate_num_samps_per_chan(
175175
number_of_samples_per_channel))
176176

177-
if waveform._start_index + number_of_samples_per_channel > waveform.capacity:
177+
if waveform.start_index + number_of_samples_per_channel > waveform.capacity:
178178
if reallocation_policy == ReallocationPolicy.TO_GROW:
179-
waveform.capacity = waveform._start_index + number_of_samples_per_channel
179+
waveform.capacity = waveform.start_index + number_of_samples_per_channel
180180
else:
181181
raise DaqError(
182-
f'The provided waveform does not have enough space ({waveform.capacity - waveform._start_index}) to hold '
182+
f'The provided waveform does not have enough space ({waveform.capacity - waveform.start_index}) to hold '
183183
f'the requested number of samples ({number_of_samples_per_channel}). Please provide a larger '
184184
'waveform or adjust the number of samples requested.',
185185
DAQmxErrors.READ_BUFFER_TOO_SMALL, task_name=self._task.name)

generated/nidaqmx/stream_readers/_digital_multi_channel_reader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -551,12 +551,12 @@ def read_waveforms(
551551
DAQmxErrors.MISMATCHED_INPUT_ARRAY_SIZES, task_name=self._task.name)
552552

553553
for i, waveform in enumerate(waveforms):
554-
if waveform._start_index + number_of_samples_per_channel > waveform.capacity:
554+
if waveform.start_index + number_of_samples_per_channel > waveform.capacity:
555555
if reallocation_policy == ReallocationPolicy.TO_GROW:
556-
waveform.capacity = waveform._start_index + number_of_samples_per_channel
556+
waveform.capacity = waveform.start_index + number_of_samples_per_channel
557557
else:
558558
raise DaqError(
559-
f'The waveform at index {i} does not have enough space ({waveform.capacity - waveform._start_index}) to hold '
559+
f'The waveform at index {i} does not have enough space ({waveform.capacity - waveform.start_index}) to hold '
560560
f'the requested number of samples ({number_of_samples_per_channel}). Please provide larger '
561561
'waveforms or adjust the number of samples requested.',
562562
DAQmxErrors.READ_BUFFER_TOO_SMALL, task_name=self._task.name)

generated/nidaqmx/stream_readers/_digital_single_channel_reader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,12 +444,12 @@ def read_waveform(
444444
self._task._calculate_num_samps_per_chan(
445445
number_of_samples_per_channel))
446446

447-
if waveform._start_index + number_of_samples_per_channel > waveform.capacity:
447+
if waveform.start_index + number_of_samples_per_channel > waveform.capacity:
448448
if reallocation_policy == ReallocationPolicy.TO_GROW:
449-
waveform.capacity = waveform._start_index + number_of_samples_per_channel
449+
waveform.capacity = waveform.start_index + number_of_samples_per_channel
450450
else:
451451
raise DaqError(
452-
f'The waveform does not have enough space ({waveform.capacity - waveform._start_index}) to hold '
452+
f'The waveform does not have enough space ({waveform.capacity - waveform.start_index}) to hold '
453453
f'the requested number of samples ({number_of_samples_per_channel}). Please '
454454
'provide a larger waveform or adjust the number of samples requested.',
455455
DAQmxErrors.READ_BUFFER_TOO_SMALL, task_name=self._task.name)

poetry.lock

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

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ 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.0dev9", allow-prereleases=true}
53+
typing_extensions = { version = ">=4.0.0" }
54+
nitypes = {version=">=0.1.0dev10", allow-prereleases=true}
5455

5556
[tool.poetry.extras]
5657
grpc = ["grpcio", "protobuf"]

src/handwritten/stream_readers/_analog_multi_channel_reader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,12 +214,12 @@ def read_waveforms(
214214
DAQmxErrors.MISMATCHED_INPUT_ARRAY_SIZES, task_name=self._task.name)
215215

216216
for i, waveform in enumerate(waveforms):
217-
if waveform._start_index + number_of_samples_per_channel > waveform.capacity:
217+
if waveform.start_index + number_of_samples_per_channel > waveform.capacity:
218218
if reallocation_policy == ReallocationPolicy.TO_GROW:
219-
waveform.capacity = waveform._start_index + number_of_samples_per_channel
219+
waveform.capacity = waveform.start_index + number_of_samples_per_channel
220220
else:
221221
raise DaqError(
222-
f'The waveform at index {i} does not have enough space ({waveform.capacity - waveform._start_index}) to hold '
222+
f'The waveform at index {i} does not have enough space ({waveform.capacity - waveform.start_index}) to hold '
223223
f'the requested number of samples ({number_of_samples_per_channel}). Please provide larger '
224224
'waveforms or adjust the number of samples requested.',
225225
DAQmxErrors.READ_BUFFER_TOO_SMALL, task_name=self._task.name)

src/handwritten/stream_readers/_analog_single_channel_reader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,12 @@ def read_waveform(
174174
self._task._calculate_num_samps_per_chan(
175175
number_of_samples_per_channel))
176176

177-
if waveform._start_index + number_of_samples_per_channel > waveform.capacity:
177+
if waveform.start_index + number_of_samples_per_channel > waveform.capacity:
178178
if reallocation_policy == ReallocationPolicy.TO_GROW:
179-
waveform.capacity = waveform._start_index + number_of_samples_per_channel
179+
waveform.capacity = waveform.start_index + number_of_samples_per_channel
180180
else:
181181
raise DaqError(
182-
f'The provided waveform does not have enough space ({waveform.capacity - waveform._start_index}) to hold '
182+
f'The provided waveform does not have enough space ({waveform.capacity - waveform.start_index}) to hold '
183183
f'the requested number of samples ({number_of_samples_per_channel}). Please provide a larger '
184184
'waveform or adjust the number of samples requested.',
185185
DAQmxErrors.READ_BUFFER_TOO_SMALL, task_name=self._task.name)

src/handwritten/stream_readers/_digital_multi_channel_reader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -551,12 +551,12 @@ def read_waveforms(
551551
DAQmxErrors.MISMATCHED_INPUT_ARRAY_SIZES, task_name=self._task.name)
552552

553553
for i, waveform in enumerate(waveforms):
554-
if waveform._start_index + number_of_samples_per_channel > waveform.capacity:
554+
if waveform.start_index + number_of_samples_per_channel > waveform.capacity:
555555
if reallocation_policy == ReallocationPolicy.TO_GROW:
556-
waveform.capacity = waveform._start_index + number_of_samples_per_channel
556+
waveform.capacity = waveform.start_index + number_of_samples_per_channel
557557
else:
558558
raise DaqError(
559-
f'The waveform at index {i} does not have enough space ({waveform.capacity - waveform._start_index}) to hold '
559+
f'The waveform at index {i} does not have enough space ({waveform.capacity - waveform.start_index}) to hold '
560560
f'the requested number of samples ({number_of_samples_per_channel}). Please provide larger '
561561
'waveforms or adjust the number of samples requested.',
562562
DAQmxErrors.READ_BUFFER_TOO_SMALL, task_name=self._task.name)

src/handwritten/stream_readers/_digital_single_channel_reader.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,12 +444,12 @@ def read_waveform(
444444
self._task._calculate_num_samps_per_chan(
445445
number_of_samples_per_channel))
446446

447-
if waveform._start_index + number_of_samples_per_channel > waveform.capacity:
447+
if waveform.start_index + number_of_samples_per_channel > waveform.capacity:
448448
if reallocation_policy == ReallocationPolicy.TO_GROW:
449-
waveform.capacity = waveform._start_index + number_of_samples_per_channel
449+
waveform.capacity = waveform.start_index + number_of_samples_per_channel
450450
else:
451451
raise DaqError(
452-
f'The waveform does not have enough space ({waveform.capacity - waveform._start_index}) to hold '
452+
f'The waveform does not have enough space ({waveform.capacity - waveform.start_index}) to hold '
453453
f'the requested number of samples ({number_of_samples_per_channel}). Please '
454454
'provide a larger waveform or adjust the number of samples requested.',
455455
DAQmxErrors.READ_BUFFER_TOO_SMALL, task_name=self._task.name)

0 commit comments

Comments
 (0)