Closed ginseil closed 7 years ago
What version of mdfreader are you using ? Looking at the code, temp can only be None, arange or inherited from buf[recordID]['data'] (line 1404) --> it comes from another class/method. Probably readBitarray or DATABlock with unsorted reading. I miss information to undesrtand what goes wrong. There has been lately regressions channel names handling that slipped out my tests, can you try again with latest commit ?
Hi ratal,
I made some tests and found the oldest commit which produced the error described above for the first time, please see the attached file: mdfreader.txt
However the latest working commit is from 10. may: 384aad995c84b22c32487978da399c57fe3e10ba. I also tried your latest changes and the result is still the same.
Hi Ginseil, Thanks for trying but I could not track back the change that could trigger this issue. I recently had to use limited naming of recarrays channels (_convertName) because it is limited to python identifiers characters. Big change that caused several regressions that were not identified by my tests. I guess your issue is one of those regressions. Could you try with a print(temp) just before the error line to understand what is temp ? Maybe also a print(type(temp)). Also some print() in readBitarray or in DATABlock for unsorted reading to confirm what is reading path ?
Hi ratal,
I think the problem is the name of one channel ('put' in my case) rather than reading its data. Furthermore content of temp at the time this error occured states that: temp is a built-in method 'put' of recarray object. It seems to be a general issue with channel names exactly matching the method names of recarray?!
However here are the results of the added prints right before the error occurs: temp: <built-in method put of recarray object at 0x000000000DE6E5F8> type: <class 'builtin_function_or_method'>
I also added prints to readBitarray, but this method has not been entered. I also took a look into DATABlock but have no idea where to add some usefull prints?!
Clearly, having 'put' as channel name is the reason of your issue. I will try to make something clean but I think you could try to implement a small cleaning condition in mdf.py, convertName function, something like this: if name in ['put','sum'] name+=name+'' It is a bit sad that recarray does not check the record name are not conflicting with its attributes.
Hi ratal,
your suggested cleaning condition works like a charm. Tanks! Would you close this ticket once this bugs is fixed?
I implemented generic name cleaning in mdf.py and removed also getattribute method call in last commit, this issue should not happen anymore.
Hi ratal,
I am no longer able to laod a mdf 4 file, which worked with pervious versions. The current version always terminates with the following AttributeError:
temp seems to be:
<built-in method put of recarray object at 0x000000000E749BA8>