Skip to content

Commit

Permalink
Skip reading channel data from segments without data for this channel (
Browse files Browse the repository at this point in the history
  • Loading branch information
adamreeve committed Mar 23, 2021
1 parent 3f50d12 commit 79af886
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nptdms/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ def read_raw_data_for_channel(self, channel_path, offset=0, length=None):
chunk_offset = 0
num_chunks = segment.num_chunks
segment_obj = segment.get_segment_object(channel_path)
chunk_size = 0 if segment_obj is None else segment_obj.number_values
chunk_size = 0 if (segment_obj is None or not segment_obj.has_data) else segment_obj.number_values
if chunk_size == 0:
continue
segment_start_index = (
0 if segment_index == first_segment else segment_offsets[segment_index - first_segment - 1])
remaining_values_to_skip = 0
Expand Down

0 comments on commit 79af886

Please sign in to comment.