vocalpy / crowsetta

A tool to work with any format for annotating vocalizations
https://crowsetta.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
49 stars 3 forks source link

CLN: Fix `GenericSeq.__repr__` to be more concise #215

Open NickleDave opened 1 year ago

NickleDave commented 1 year ago

The current __repr__ of GenericSeq (default we get from attrs) is very verbose but not in a way that would be super helpful, especially when there its annot attribute has many crowsetta.Annotation instances.

The example I'm working with in a vignette gives something like this

Number of annotation instances from Giraudon et al. 2021: 459 Converted to 'generic-seq': GenericSeq(annots=[Annotation(annot_path=PosixPath('data/audacity-annotations/100_marron1_May_24_2016_62101389.audacity.txt'), notated_path=None, seq=<Sequence with 77 segments>), Annotation(annot_path=PosixPath('data/audacity-annotations/101_marron1_May_24_2016_64441045.audacity.txt'), notated_path=None, seq=<Sequence with 48 segments>), Annotation(annot_path=PosixPath('data/audacity-annotations/102_marron1_May_24_2016_69341205.audacity.txt'), notated_path=None, seq=<Sequence with 59 segments>), Annotation(annot_path=PosixPath('data/audacity-annotations/103_marron1_May_24_2016_73006746.audacity.txt'), notated_path=None, seq=<Sequence with 19 segments>), Annotation(annot_path=PosixPath('data/audacity-annotations/104_marron1_May_24_2016_73006746.audacity.txt'), notated_path=None, seq=<Sequence with 52 segments>), Annotation(annot_path=PosixPath('data/audacity-annotations/... (with many more lines)