treams.util.AnnotationSequence

class treams.util.AnnotationSequence(*args, mapping=<class 'treams.util.AnnotationDict'>)

A Sequence of dictionaries.

This class is intended to work together with AnnotationDict. It provides convenience functions to interact with multiple of those dictionaries, which are mainly used to keep track of the annotations made to each dimension of an AnnotatedArray. While the sequence itself is immutable the entries of each dictionary is mutable.

Parameters:
  • *args – Items of the sequence

  • mapping (AnnotationDict) – Type of mapping to use in the sequence.

Warns:

AnnotationWarning

Attributes

as_dict

Methods

__add__(other)

__eq__(other)

Equality test.

__ge__(value, /)

Return self>=value.

__getitem__(key)

Get an item or subsequence.

__gt__(value, /)

Return self>value.

__le__(value, /)

Return self<=value.

__len__()

Number of dictionaries in the sequence.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__repr__()

String representation.

__str__()

Return str(self).

count(value)

index(value, [start, [stop]])

Raises ValueError if the value is not present.

match(other)

Match all mappings at once.

update(other)

Update all mappings in the sequence at once.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__str__()

Return str(self).

__ge__(value, /)

Return self>=value.

__gt__(value, /)

Return self>value.

__ne__(value, /)

Return self!=value.