cesium-ml / cesium

Machine Learning Time-Series Platform
Other
671 stars 101 forks source link

Use another augmented assignment statement #302

Closed elfring closed 2 years ago

elfring commented 2 years ago

:eyes: Some source code analysis tools can help to find opportunities for improving software components. :thought_balloon: I propose to increase the usage of augmented assignment statements accordingly.

diff --git a/cesium/features/period_folding.py b/cesium/features/period_folding.py
index 7849b3f..b4b22ad 100644
--- a/cesium/features/period_folding.py
+++ b/cesium/features/period_folding.py
@@ -68,7 +68,7 @@ def p2p_model(x, y, frequency):
     median_diff = np.median(np.abs(np.diff(y)))
     mad = cf.median_absolute_deviation(y)
     x = x.copy()
-    x = x - min(x)
+    x -= min(x)

     t_2per_fold = np.array(x % (2. / frequency))
     t_2per_sort_inds = np.argsort(t_2per_fold)
elfring commented 2 years ago

:thought_balloon: I would appreciate another bit of constructive feedback.