Skip to content

Commit 670cd71

Browse files
Updated base.py (#86)
- channels_buffer_adc_to_mv() simplified as rapid block now uses numpy arrays instead of lists. It can now use the standard conversion.
1 parent 946ea2e commit 670cd71

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

pypicosdk/base.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -742,13 +742,7 @@ def channels_buffer_adc_to_mv(self, channels_buffer: dict) -> dict:
742742
# Extract data
743743
data = channels_buffer[channel]
744744

745-
# If data is rapid block array
746-
if type(data[0]) == np.ndarray:
747-
for n, array in enumerate(data):
748-
channels_buffer[channel][n] = ((array / self.max_adc_value) * channel_range_mv) * channel_scale
749-
# Else anything else is converted normally
750-
else:
751-
channels_buffer[channel] = ((data / self.max_adc_value) * channel_range_mv) * channel_scale
745+
channels_buffer[channel] = ((data / self.max_adc_value) * channel_range_mv) * channel_scale
752746
return channels_buffer
753747

754748
def buffer_ctypes_to_list(self, ctypes_list):

0 commit comments

Comments
 (0)