Skip to content

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

Open

Description

@NickleDave

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions