distancematrix.consumer.abstract_consumer

Module Contents

Classes

AbstractConsumer

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

AbstractStreamingConsumer

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

class distancematrix.consumer.abstract_consumer.AbstractConsumer

Bases: abc.ABC

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

abstract initialise(self, dims, query_subseq, series_subseq)

Initialise this consumer.

Parameters
  • dims – the number of dimensions (data channels) this consumer will receive

  • query_subseq – the number of query subsequences (rows in the distance matrix)

  • series_subseq – the number of series subsequences (column in the distance matrix)

Returns

None

abstract process_diagonal(self, diagonal_index, values)

Method called when a diagonal of the distance matrix is calculated.

The number of values on the diagonal might be less than the diagonal of the full matrix profile, this can occur when not enough data is available yet to calculate the entire distance matrix (typically for streaming when not enough data is available to fill the entire foreseen space).

Parameters
  • diagonal_index – index of the diagonal in range ]-num_query_subseq, num_series_subseq[, the main diagonal has index 0

  • values – array of shape (num_dimensions, num_values_on_diagonal) containing the distances

Returns

None

abstract process_column(self, column_index, values)

Method called when a column of the distance matrix is calculated.

The number of values on the column might be less than the column of the full matrix profile, this can occur when not enough data is available yet to calculate the entire distance matrix (typically for streaming when not enough data is available to fill the entire foreseen space).

Parameters
  • column_index – index of the column, in range [0, series_subseq[

  • values – array of shape (num_dimensions, num_values_on_column) containing the distances

Returns

None

class distancematrix.consumer.abstract_consumer.AbstractStreamingConsumer

Bases: distancematrix.consumer.abstract_consumer.AbstractConsumer

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

abstract shift_query(self, amount)

Inform the consumer that the distance matrix has shifted in the query direction.

Parameters

amount – amount of subsequences that were shifted

Returns

None

abstract shift_series(self, amount)

Inform the consumer that the distance matrix has shifted in the series direction.

Parameters

amount – amount of subsequences that were shifted

Returns

None