cta-observatory/dragonboard_testbench

bug in EventGetter.__repr__

Closed this issue · 1 comments

When trying to print the EventGetter it throws:

In [1]: import dragonboard as db

In [2]: eg = db.EventGenerator("../raw_data_20160229/20160229_185742_ExtTrgRand/Ped_Rand1kHz_No5_IP90.dat")

In [3]: eg
Out[3]: ---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/home/dneise/anaconda3__new/lib/python3.5/site-packages/IPython/core/formatters.py in __call__(self, obj)
    697                 type_pprinters=self.type_printers,
    698                 deferred_pprinters=self.deferred_printers)
--> 699             printer.pretty(obj)
    700             printer.flush()
    701             return stream.getvalue()

/home/dneise/anaconda3__new/lib/python3.5/site-packages/IPython/lib/pretty.py in pretty(self, obj)
    381                             if callable(meth):
    382                                 return meth(obj, self, cycle)
--> 383             return _default_pprint(obj, self, cycle)
    384         finally:
    385             self.end_group()

/home/dneise/anaconda3__new/lib/python3.5/site-packages/IPython/lib/pretty.py in _default_pprint(obj, p, cycle)
    501     if _safe_getattr(klass, '__repr__', None) not in _baseclass_reprs:
    502         # A user-provided repr. Find newlines and replace them with p.break_()
--> 503         _repr_pprint(obj, p, cycle)
    504         return
    505     p.begin_group(1, '<')

/home/dneise/anaconda3__new/lib/python3.5/site-packages/IPython/lib/pretty.py in _repr_pprint(obj, p, cycle)
    692     """A pprint that just redirects to the normal repr function."""
    693     # Find newlines and replace them with p.break_()
--> 694     output = repr(obj)
    695     for idx,output_line in enumerate(output.splitlines()):
    696         if idx:

/home/dneise/LST/dbtb_new/dragonboard/io.py in __repr__(self)
     67         ).format(
     68             name=self.__class__.__name__,
---> 69             S=self
     70         )
     71 

AttributeError: 'EventGenerator_v5_1_0B' object has no attribute '_length'

This got fixed by merging #32