ratal / mdfreader

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

error in write method when noDataLoading=True #82

Closed danielhrisca closed 7 years ago

danielhrisca commented 7 years ago

Benchmark environment

3.6.2 (default, Jul 20 2017, 03:52:27)
[GCC 7.1.1 20170630]
Linux-4.9.40-1-MANJARO-x86_64-with-glibc2.3.4

The files used are the test files.

With mdf version 3 I get the error:

Traceback (most recent call last):
  File "/usr/lib/python3.6/multiprocessing/process.py", line 249, in _bootstrap
    self.run()
  File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "/home/daniel/.config/spyder-py3/temp.py", line 185, in save_reader3_nodata
    x.write(r'x.mdf')
  File "/usr/lib/python3.6/site-packages/mdfreader/mdfreader.py", line 421, in write
    self.write3(fileName=self.fileName)
  File "/usr/lib/python3.6/site-packages/mdfreader/mdf3reader.py", line 1276, in write3
    nRecords = len(masterData)

With mdf version 4 I get the error:

Traceback (most recent call last):
  File "/usr/lib/python3.6/multiprocessing/process.py", line 249, in _bootstrap
    self.run()
  File "/usr/lib/python3.6/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "/home/daniel/.config/spyder-py3/temp.py", line 137, in save_reader4_nodata
    x.write(r'x.mf4')
  File "/usr/lib/python3.6/site-packages/mdfreader/mdfreader.py", line 419, in write
    self.convertAllChannel()
  File "/usr/lib/python3.6/site-packages/mdfreader/mdfreader.py", line 454, in convertAllChannel
    return self._convertAllChannel4()
  File "/usr/lib/python3.6/site-packages/mdfreader/mdf4reader.py", line 1625, in _convertAllChannel4
    [self._convertChannel4(channelName) for channelName in self]
  File "/usr/lib/python3.6/site-packages/mdfreader/mdf4reader.py", line 1625, in <listcomp>
    [self._convertChannel4(channelName) for channelName in self]
  File "/usr/lib/python3.6/site-packages/mdfreader/mdf4reader.py", line 1617, in _convertChannel4
    self.setChannelData(channelName, self._getChannelData4(channelName))
  File "/usr/lib/python3.6/site-packages/mdfreader/mdf4reader.py", line 1545, in _getChannelData4
    self.read4(fileName=None, info=self._info, channelList=[channelName], convertAfterRead=False)
  File "/usr/lib/python3.6/site-packages/mdfreader/mdf4reader.py", line 1441, in read4
    buf.read(channelSet)  # reads raw data from data block with DATA and DATABlock classes
  File "/usr/lib/python3.6/site-packages/mdfreader/mdf4reader.py", line 363, in read
    self[recordID]['data'] = self.load(record, zip=None, nameList=channelSet, sortedFlag=True)
  File "/usr/lib/python3.6/site-packages/mdfreader/mdf4reader.py", line 455, in load
    raise Exception('unknown data block')
Exception: unknown data block
ratal commented 7 years ago

This one should also be fixed from last tests

danielhrisca commented 7 years ago

working now