danielhrisca / asammdf

Fast Python reader and editor for ASAM MDF / MF4 (Measurement Data Format) files
GNU Lesser General Public License v3.0
655 stars 226 forks source link

AttributeError: 'tuple' object has no attribute 'axis_channels' #1075

Open sunyuzhe2017 opened 2 months ago

sunyuzhe2017 commented 2 months ago

version 7.4.5 when I use "cut", I got this error,

  m_cut = m.cut(start_time,stop_time,version="4.10")
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/test/miniconda3/lib/python3.12/site-packages/asammdf/mdf.py", line 924, in cut
    included_channels = self.included_channels(group_index)[group_index]
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/test/miniconda3/lib/python3.12/site-packages/asammdf/blocks/mdf_v4.py", line 7971, in included_channels
    dep.axis_channels,
    ^^^^^^^^^^^^^^^^^
AttributeError: 'tuple' object has no attribute 'axis_channels'

and I add two line code after this line https://github.com/danielhrisca/asammdf/blob/c9d0e449000ed70f2ea1dd47df7c80f3e74471c5/src/asammdf/blocks/mdf_v4.py#L7969C25-L7969C49 as follows to skip, hope you can check and fix it, thanks

    # ...
    for dep in dependencies:
        if not isinstance(dep, ChannelArrayBlock):
            continue
        for referenced_channels in (
            dep.axis_channels,
            dep.dynamic_size_channels,
            dep.input_quantity_channels,
        ):
    # ...
danielhrisca commented 2 months ago

the original MDF file would be useful to understand the root cause of the problem

sunyuzhe2017 commented 2 months ago

the original MDF file would be useful to understand the root cause of the problem

Recorder_2024-09-07_17-17-13_Cut_1-26s_canape.zip