Skip to content

Commit

Permalink
fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
VorobiovM committed Feb 27, 2024
1 parent d6e0012 commit 114a683
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/asammdf/blocks/mdf_v4.py
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ def _read_channels(
)

first_dep = ca_block = ChannelArrayBlock(address=component_addr, stream=stream, mapped=mapped)
ca_list = [first_dep]
dependencies[index] = [first_dep]

while ca_block.composition_addr:
stream.seek(ca_block.composition_addr)
Expand All @@ -1041,11 +1041,10 @@ def _read_channels(
stream=stream,
mapped=mapped,
)
ca_list.append(ca_block)
dependencies[index].append(ca_block)

elif channel.data_type == v4c.DATA_TYPE_BYTEARRAY:
# read CA-CN nested structure
dependencies[index] = ca_list[:]
(
ch_cntr,
ret_composition,
Expand All @@ -1060,6 +1059,7 @@ def _read_channels(
mapped=mapped,
)

ca_cnt = len(dependencies[index])
if ret_composition:
dependencies[index].extend(ret_composition)

Expand All @@ -1068,7 +1068,7 @@ def _read_channels(
dimensions = []
total_elem = 1

for ca_blck in ca_list:
for ca_blck in dependencies[index][:ca_cnt]:
# only consider CN templates
if ca_blck.ca_type != v4c.CA_STORAGE_TYPE_CN_TEMPLATE:
logger.warning("Only CN template arrays are supported")
Expand Down

0 comments on commit 114a683

Please sign in to comment.