ldfparser icon indicating copy to clipboard operation
ldfparser copied to clipboard

AttributeError: 'LinUnconditionalFrame' object has no attribute 'signals'

Open E-genin opened this issue 2 years ago • 2 comments

I am trying to run the following script on an *.ldf file (including the one in the example folder lin22.ldf) :

import ldfparser ldf = ldfparser.parse_ldf('lin22.ldf') for frame in ldf.frames: print(frame.name) print(frame.signals)

I get the following error : AttributeError: 'LinUnconditionalFrame' object has no attribute 'signals' even if the documentation suggests otherwise :

... """ LinUnconditionalFrame represents an unconditional frame consisting of signals :param frame_id: Frame identifier :type frame_id: int :param name: Name of the frame :type name: str :param length: Length of the frame in bytes :type length: int :param signals: Signals of the frame # <===== :type signals: Dict[int, LinSignal] """

E-genin avatar Aug 21 '23 14:08 E-genin

This is a mistake in the documentation, that field has been renamed to signal_map. Sadly the project still has no proper docstring based documentation so I wouldn't rely on them

I'll keep this issue open and close it once we have something usable.

c4deszes avatar Aug 21 '23 14:08 c4deszes

This is a mistake in the documentation, that field has been renamed to signal_map. Sadly the project still has no proper docstring based documentation so I wouldn't rely on them

I'll keep this issue open and close it once we have something usable.

Oh thanks @c4deszes for the help 👍

E-genin avatar Aug 21 '23 15:08 E-genin