Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MDF.extract_bus_logging() issues after 7.3.17 release. #1096

Open
DanielRaceOn opened this issue Nov 15, 2024 · 2 comments
Open

MDF.extract_bus_logging() issues after 7.3.17 release. #1096

DanielRaceOn opened this issue Nov 15, 2024 · 2 comments

Comments

@DanielRaceOn
Copy link

Python version

('python=3.11.9 (tags/v3.11.9:de54cf5, Apr 2 2024, 10:12:12) [MSC v.1938 64 '
'bit (AMD64)]')
'os=Windows-10-10.0.26100-SP0'
'numpy=1.26.4'
'asammdf>=7.3.17'

Code

MDF version

MDF 4.11

Code snippet

        #Open log file and extract signals from raw bus format
        with MDF(LogFilePath) as mdf:
            log_mdf = mdf.extract_bus_logging(database_files=db_dict)

Traceback

1. issue:

Returns [] instead of mdf object

2. issue:

Traceback (most recent call last):
File "_root_tests-mdf.py", line 44, in <module>
  log_data_df = can.mdf.get_data(LogFilePath=MDFFilePath, DbFilePath=DBCFilePath2)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "_root_src\raceoncan\utils\benchmark.py", line 43, in wrapper  
  value = func(*args,**kwargs)
          ^^^^^^^^^^^^^^^^^^^^
File "_root_src\raceoncan\mdf.py", line 146, in get_data
  log_mdf = mdf.extract_bus_logging(database_files=db_dict)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "_root_.venv\Lib\site-packages\asammdf\mdf.py", line 4784, in extract_bus_logging
  out = self._extract_can_logging(
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
File "_root_.venv\Lib\site-packages\asammdf\mdf.py", line 5123, in _extract_can_logging
  out.extend(index, sigs)
File "_root_.venv\Lib\site-packages\asammdf\blocks\mdf_v4.py", line 5833, in extend
  if (origin := invalidation_bits.origin) == InvalidationArray.ORIGIN_UNKNOWN:
                ^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'numpy.ndarray' object has no attribute 'origin'

Description

The MDF.extract_bus_logging function block seems to has been significantly modified in 7.3.17 release, but since then, it struggles with extracting some standard raw CAN BUS log file (think it's CSS logger file) and returns empty list.

Other instance of problem is error and traceback when extracting bigger file from Vector software.

With asammdf 7.3.16 all works fine and function returns decoded mdf object in both cases.

Scrambled files can be provided if necessary.

Best regards,
Daniel

danielhrisca added a commit that referenced this issue Nov 18, 2024
@danielhrisca
Copy link
Owner

@DanielRaceOn please try the development branch code

@DanielRaceOn
Copy link
Author

Hi @danielhrisca, thanks for immediate response!
I've tested with 8.1.0.dev1 and now in both problematic cases it returns empty MDF object (0 groups):

{'version': '4.11', 'program': 'amdf8.1.0.dev1', 'comment': '<HDcomment>\n <TX/>\n <common_properties/>\n</HDcomment>', 'groups': 0}
{'version': '4.10', 'program': 'amdf8.1.0.dev1', 'comment': '<HDcomment>\n <TX/>\n <common_properties/>\n</HDcomment>', 'groups': 0}

However, it seems to work fine with some other sample files.
Let me know if you want to take a look at scrambled files.

Best regards,
Daniel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants