ratal / mdfreader

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

No string representation of mdfreader object #155

Closed proedig closed 5 years ago

proedig commented 5 years ago

Python version '3.6.5 |Anaconda, Inc.| (default, Mar 29 2018, 13:32:41) [MSC v.1900 64 bit (AMD64)]'

Platform information 'Windows-10-10.0.14393-SP0'

Numpy version '1.14.3'

mdfreader version mdfreader 2.7.8 Tree mdfreader-0895a77c733f0b9ddf167dfd3cbceb24a66ad732

Description

Hi! I noticed that there is no string representation of the generated mdfreaderobject:

yop = mdfreader.mdf(file) print(yop)

results in TypeError: __str__ returned non-string (type list)

I also tried just yop without print(). Results in no output.

ratal commented 5 years ago

mdf (mdfreader.py) inherits of mdf3,mdf4 (mdf3reader.py,mdf4reader.py), which itself inherits from mdf_skeleton (mdf.py) that includes str when I use ipython, I can get a print of yop. However, I could reproduce your issue with print(yop). str ouput nested list. ipython print does not complain but print() gives same error as yours -> I corrected in dev branch, should be fixed for you. You can customise according to your needs str, do not hesitate to propose modifications.

proedig commented 5 years ago

I tested the latest dev branch, looks fine now. Problem solved, thanks!