asammdf icon indicating copy to clipboard operation
asammdf copied to clipboard

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

Open sunyuzhe2017 opened this issue 1 year ago • 2 comments

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,
        ):
    # ...

sunyuzhe2017 avatar Sep 08 '24 13:09 sunyuzhe2017

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

danielhrisca avatar Sep 09 '24 11:09 danielhrisca

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

sunyuzhe2017 avatar Sep 12 '24 12:09 sunyuzhe2017