distancematrix.consumer.contextmanager

Module Contents

Classes

AbstractContextManager

Helper class that provides a standard way to create an ABC using

GeneralStaticManager

General purpose context manager for contextual matrix profile. This manager does not support streaming data.

class distancematrix.consumer.contextmanager.AbstractContextManager

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

abstract query_contexts(self, start: int, stop: int) Iterable[Tuple[int, int, int]]

Return all non-empty query context definitions that fall in the given range of the distance matrix query axis.

Parameters
  • start – start of the range

  • stop – end of the range

Returns

iterable of tuples (start of context, end of context, context id)

abstract series_contexts(self, start: int, stop: int) Iterable[Tuple[int, int, int]]

Return all non-empty series context definitions that fall in the given range of the distance matrix series axis.

Parameters
  • start – start of the range

  • stop – end of the range

Returns

iterable of tuples (start of context, end of context, context id)

abstract context_matrix_shape(self)

Returns the shape of the contextual distance matrix

Returns

upper bound for any context id returned by this manager, for query and series axis

shift_query(self, amount: int) int

Informs the manager that the distance matrix has shifted along the query axis.

Parameters

amount – amount of values shifted

Returns

the amount of values that the contextual distance matrix should shift along the query axis

shift_series(self, amount: int) int

Informs the manager that the distance matrix has shifted along the series axis.

Parameters

amount – amount of values shifted

Returns

the amount of values that the contextual distance matrix should shift along the series axis

class distancematrix.consumer.contextmanager.GeneralStaticManager(series_contexts, query_contexts=None)

Bases: distancematrix.consumer.contextmanager.AbstractContextManager

General purpose context manager for contextual matrix profile. This manager does not support streaming data.

context_matrix_shape(self)

Returns the shape of the contextual distance matrix

Returns

upper bound for any context id returned by this manager, for query and series axis

series_contexts(self, start, stop)

Return all non-empty series context definitions that fall in the given range of the distance matrix series axis.

Parameters
  • start – start of the range

  • stop – end of the range

Returns

iterable of tuples (start of context, end of context, context id)

query_contexts(self, start, stop)

Return all non-empty query context definitions that fall in the given range of the distance matrix query axis.

Parameters
  • start – start of the range

  • stop – end of the range

Returns

iterable of tuples (start of context, end of context, context id)