From b3d6d203fb6f6dac2683d7fe751bcddee1524b40 Mon Sep 17 00:00:00 2001 From: fleur <spacecarrot@fleurshax.net> Date: Wed, 23 Oct 2019 16:18:58 +0200 Subject: [PATCH] i'll make my own code style it'll be terrible --- preload/apps/ecg/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/preload/apps/ecg/__init__.py b/preload/apps/ecg/__init__.py index 59466eff..da30babc 100644 --- a/preload/apps/ecg/__init__.py +++ b/preload/apps/ecg/__init__.py @@ -57,7 +57,8 @@ COLORS = [((23 + (15 * i)) % 360, 1.0, 1.0) for i in range(11)] moving_average = 0 alpha = 2 beta = 3 -betadash = beta/(alpha+beta) +betadash = beta / (alpha + beta) + def update_history(datasets): global history, moving_average, alpha, beta, last_sample_count @@ -65,7 +66,7 @@ def update_history(datasets): for val in datasets: if current_mode == MODE_FINGER: history.append(val - moving_average) - moving_average += betadash*(val-moving_average) + moving_average += betadash * (val - moving_average) # identical to: moving_average = (alpha * moving_average + beta * val) / (alpha + beta) else: history.append(val) -- GitLab