Skip to content

incorrect number of iterations in snippets._get_all_mpdist_profiles #890

@NimaSarajpoor

Description

@NimaSarajpoor

Issue

In the function _get_all_mpdist_profiless, the time series T is extended so that to have a length that is a multiples of m.

https://github.com/TDAmeritrade/stumpy/blob/1ddb95036dc4ce1d3179b3bb6cb9fb80c4be529a/stumpy/snippets.py#L103-L108

Note that the length of the original T does not change IF len(T) % m == 0. In such case, it seems that the following for-loop misses the last non-overlapping window of length m

https://github.com/TDAmeritrade/stumpy/blob/1ddb95036dc4ce1d3179b3bb6cb9fb80c4be529a/stumpy/snippets.py#L113-L123

Solution

Before the if check if T.shape[0] % m != 0:, we may add: n_windows = T.shape[0] // m and then we do for-loop using range(n_windows)

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