cta-observatory / ctapipe

Low-level data processing pipeline software for CTAO or similar arrays of Imaging Atmospheric Cherenkov Telescopes
https://ctapipe.readthedocs.org
BSD 3-Clause "New" or "Revised" License
65 stars 269 forks source link

Add nice __repr__ s to the reference metadata objects #2649

Closed maxnoe closed 1 week ago

maxnoe commented 2 weeks ago

Please describe the use case that requires this feature.

The Reference metadata objects currently do not have reprs:

(Pdb) str(inputs[0]["reference_meta"].product)
'<ctapipe.io.metadata.Product object at 0x7f82685366d0>'

Describe the solution you'd like Add reprs

kosack commented 2 weeks ago

Some have reprs, but it is not consistent. Could just use the _to_dict(self) helper function in that module as a general way.