ratal / mdfreader

Read Measurement Data Format (MDF) versions 3.x and 4.x file formats in python
Other
169 stars 74 forks source link

ValueError: could not broadcast input array from shape (7) into shape (6) #107

Closed ginseil closed 6 years ago

ginseil commented 6 years ago

Hi,

I am unable to open a MDF4 file due to the following error:

File "..\format\mdf\converter.py", line 149, in _load_mdf_data mdf = mdfreader.mdf(self.source, convertAfterRead=False) File "..\site-packages\mdfreader-0.2.7-py3.6-win-amd64.egg\mdfreader\mdf.py", line 149, in init compression=compression) File "..\site-packages\mdfreader-0.2.7-py3.6-win-amd64.egg\mdfreader\mdfreader.py", line 407, in read convertAfterRead, filterChannelNames, compression) File "..\site-packages\mdfreader-0.2.7-py3.6-win-amd64.egg\mdfreader\mdf4reader.py", line 1089, in read4 buf.read(channelSet, info) # reads raw data from data block with DATA and DATABlock classes File "..\site-packages\mdfreader-0.2.7-py3.6-win-amd64.egg\mdfreader\mdf4reader.py", line 375, in read rec = append_field(rec, recAttributeName, temp) File "..\site-packages\mdfreader-0.2.7-py3.6-win-amd64.egg\mdfreader\mdf4reader.py", line 267, in append_field newrec[name] = arr ValueError: could not broadcast input array from shape (7) into shape (6)

Below are the properties of the CN block causing the exception above: image

ginseil commented 6 years ago

Hi Aymeric, do you have an idea when this bug will be fixed?

ratal commented 6 years ago

Working on it but delicate without the file as usual. For the moment, I can say you have a file configuration I could never test so far : a VLSD channel which data is embedded into a Data zipped block. It should not be the issue. Can you tell me how much records are contained from the channel group information ? I guess ChassisNumber is not changing with time, could be the corner case. But it seems more a size issue between rec and temp, problem loading temp. Can you print both rec and temp before the append_field ?

ginseil commented 6 years ago

Hi Aymeric, I can provide you my test file. What is your email?

danielhrisca commented 6 years ago

@ginseil Hey, could I also get your test file to run it against my lib? You have my email in the profile.

ratal commented 6 years ago

my email : aymeric.rateau@gmail.com It should be in the license disclaimer/header. Thanks, will be easier !

ginseil commented 6 years ago

Now I can open the file but the value sequence for ChassisNumber seems to be broken...

ratal commented 6 years ago

Should be fixed in last commit, please check if ok for you.

ginseil commented 6 years ago

Works, Thanks!