Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
laszukdawid committed Sep 11, 2024
1 parent 9372aa8 commit 1e78b26
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions PyEMD/EMD_matlab.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,7 @@ def extractMaxMinSpline(self, T, S):
return [-1] * 4

# Extrapolation of signal (ober boundaries)
maxExtrema, minExtrema = self.preparePoints(
S, T, maxPos, maxVal, minPos, minVal
)
maxExtrema, minExtrema = self.preparePoints(S, T, maxPos, maxVal, minPos, minVal)

_, maxSpline = self.splinePoints(T, maxExtrema, self.splineKind)
_, minSpline = self.splinePoints(T, minExtrema, self.splineKind)
Expand Down Expand Up @@ -220,12 +218,8 @@ def preparePoints(self, S, T, maxPos, maxVal, minPos, minVal):
minExtrema = np.array([tmin, zmin], dtype=self.DTYPE)

# Make double sure, that each extremum is significant
maxExtrema = np.delete(
maxExtrema, np.where(maxExtrema[0, 1:] == maxExtrema[0, :-1]), axis=1
)
minExtrema = np.delete(
minExtrema, np.where(minExtrema[0, 1:] == minExtrema[0, :-1]), axis=1
)
maxExtrema = np.delete(maxExtrema, np.where(maxExtrema[0, 1:] == maxExtrema[0, :-1]), axis=1)
minExtrema = np.delete(minExtrema, np.where(minExtrema[0, 1:] == minExtrema[0, :-1]), axis=1)

return maxExtrema, minExtrema

Expand Down Expand Up @@ -257,9 +251,7 @@ def splinePoints(self, T, extrema, splineKind):

elif kind == "cubic":
if extrema.shape[1] > 3:
return t, interp1d(extrema[0], extrema[1], kind=kind)(t).astype(
self.DTYPE
)
return t, interp1d(extrema[0], extrema[1], kind=kind)(t).astype(self.DTYPE)
else:
return self.cubicSpline_3points(T, extrema)

Expand Down

0 comments on commit 1e78b26

Please sign in to comment.