Closed DocBO closed 6 years ago
Another point: the textConversion is awfully slow. But if you read in an unknown data file it would be nice to have a flag something like skipTextConversion. My read-in time (for all channels) goes from 3 sec down to 0.15 sec if I skip that conversion.
Thanks for reporting, I will put your modification in the code but trying to find out why it gets None could help improving its robustness, maybe by analysing with mdfvalidator ? I know it is slow conversion, I could not find any other way to make it more efficient so far, tried several approaches but except by coding it in cython, I do not see any other way. Putting a flag for all corner cases will also become awful. However, you could try to use the argument convertAfterRead=False: this conversion will not be done until you need to access the data with .getChannelData(channelName).
Looking at your issue a bit deeper, I realised you are not the only one to have this comment and attribute "convert_tables" was already implemented for mdf version 4.x but not 3.x for this purpose. In last commit, I implemented it also for mdf3.x If you want to activate it, you can modify its value in mdf.py from True to False.
Thanks, you have a nice and active project going on here!
I guess you could try it successfully, closing. Repoen if you still have issues.
For my mdf files of version 3 I had problems in the general reader. I figured out, that it had to do with the text converter which happens to fail in the general try--except block (which is not good!). In my mdf3 file the Textrange item happens to be None, several times, so the line if 'LINEAR_CONV' in text[pair] failed obviously.
I would suggest to fix that with an explicit None - exclude.