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

export to MDF 3 is broken #1050

Closed mm-mm-bb closed 4 months ago

mm-mm-bb commented 4 months ago

Python version

Build information: version 7.4.5 PySide6 6.6.0 CPython 3.12.4 x64

Description

exporting a file to MDF3.30 from the gui generate error

Traceback (most recent call last):
  File "C:\Users\asd\AppData\Roaming\Python\Python312\site-packages\asammdf\gui\utils.py", line 246, in run
    result = self.function(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\asd\AppData\Roaming\Python\Python312\site-packages\asammdf\gui\widgets\file.py", line 2844, in apply_processing_thread
    result = self.mdf.convert(
             ^^^^^^^^^^^^^^^^^
  File "C:\Users\asd\AppData\Roaming\Python\Python312\site-packages\asammdf\mdf.py", line 800, in convert
    cg_nr = out.append(
            ^^^^^^^^^^^
  File "C:\Users\asd\AppData\Roaming\Python\Python312\site-packages\asammdf\blocks\mdf_v3.py", line 1570, in append
    samples = fromarrays(new_fields, dtype=new_types)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\asd\AppData\Roaming\Python\Python312\site-packages\numpy\core\records.py", line 676, in fromarrays
    raise ValueError(f'array-shape mismatch in array {k} ("{name}")')
ValueError: array-shape mismatch in array 6 ("CAN_DataFrame.DataBytes")
danielhrisca commented 4 months ago

@mm-mm-bb please try the development branch code

mm-mm-bb commented 4 months ago

Works. For reference, it installed f40f68ddbb553e0a7f4d0eb51758ad012471f406 with the command

pip install git+https://github.com/danielhrisca/asammdf.git@development