File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -145,19 +145,20 @@ def mass_PI(
145145 T_subseq_isconstant = rolling_isconstant (T , m , T_subseq_isconstant )
146146
147147 D = distance_profile (Q , T , m )
148+ D [np .isnan (D )] = np .inf
148149 for i in range (len (T ) - m + 1 ):
149- if Q_subseq_isconstant and T_subseq_isconstant [i ]:
150- D [i ] = 0
151- elif Q_subseq_isconstant or T_subseq_isconstant [i ]:
152- D [i ] = np .sqrt (m )
153- else : # pragma: no cover
154- pass
150+ if np .isfinite (D [i ]):
151+ if Q_subseq_isconstant and T_subseq_isconstant [i ]:
152+ D [i ] = 0
153+ elif Q_subseq_isconstant or T_subseq_isconstant [i ]:
154+ D [i ] = np .sqrt (m )
155+ else : # pragma: no cover
156+ pass
155157
156158 if ignore_trivial :
157159 apply_exclusion_zone (D , trivial_idx , excl_zone , np .inf )
158160 start = max (0 , trivial_idx - excl_zone )
159161 stop = min (D .shape [0 ], trivial_idx + excl_zone + 1 )
160- D [np .isnan (D )] = np .inf
161162
162163 I = np .argmin (D )
163164 P = D [I ]
You can’t perform that action at this time.
0 commit comments