Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
1 task
NickleDave opened this issue Dec 31, 2022 · 0 comments
Open
1 task

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

NickleDave opened this issue Dec 31, 2022 · 0 comments

Comments

@NickleDave
Copy link
Collaborator

NickleDave commented Dec 31, 2022

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)

  • use reprlib to make concise, esp for many annotations. Might have to write a __repr__ with an if statement that checks the length of the annot attribute
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant