MCPcopy
hub / github.com/stumpy-dev/stumpy / update

Method update

stumpy/scraamp.py:747–789  ·  view source on GitHub ↗

Update the (top-k) matrix profile and the (top-k) matrix profile indices by computing additional new distances (limited by `percentage`) that make up the full distance matrix. Parameters ---------- None Returns ------- None

(self)

Source from the content-addressed store, hash-verified

745 self._chunk_idx = 0
746
747 def update(self):
748 """
749 Update the (top-k) matrix profile and the (top-k) matrix profile indices by
750 computing additional new distances (limited by `percentage`) that make up
751 the full distance matrix.
752
753 Parameters
754 ----------
755 None
756
757 Returns
758 -------
759 None
760 """
761 if self._chunk_idx < self._n_chunks:
762 start_idx, stop_idx = self._chunk_diags_ranges[self._chunk_idx]
763
764 P, PL, PR, I, IL, IR = _aamp(
765 self._T_A,
766 self._T_B,
767 self._m,
768 self._T_A_subseq_isfinite,
769 self._T_B_subseq_isfinite,
770 self._p,
771 self._diags[start_idx:stop_idx],
772 self._ignore_trivial,
773 self._k,
774 )
775
776 # Update (top-k) matrix profile and indices
777 core._merge_topk_PI(self._P, P, self._I, I)
778
779 # update left matrix profile and indices
780 mask = PL < self._PL
781 self._PL[mask] = PL[mask]
782 self._IL[mask] = IL[mask]
783
784 # update right matrix profile and indices
785 mask = PR < self._PR
786 self._PR[mask] = PR[mask]
787 self._IR[mask] = IR[mask]
788
789 self._chunk_idx += 1
790
791 @property
792 def P_(self):

Callers

nothing calls this directly

Calls 1

_aampFunction · 0.85

Tested by

no test coverage detected