From e0bf5b317c8f74e792e20f33e59c4feb0fb89c2f Mon Sep 17 00:00:00 2001 From: antoinefalisse Date: Mon, 29 Jul 2024 19:57:00 -0700 Subject: [PATCH] fix bug remove --- gait_analysis/function/handler.py | 12 ++++++++---- squat_analysis/function/handler.py | 12 ++++++++---- treadmill_gait_analysis/function/handler.py | 12 ++++++++---- 3 files changed, 24 insertions(+), 12 deletions(-) diff --git a/gait_analysis/function/handler.py b/gait_analysis/function/handler.py index 127c2c7..5bff5f2 100644 --- a/gait_analysis/function/handler.py +++ b/gait_analysis/function/handler.py @@ -209,10 +209,14 @@ def handler(event, context): # Available options for line curve chart. y_axes = list(colNames) y_axes.remove('time') - y_axes.remove('knee_angle_r_beta') - y_axes.remove('knee_angle_l_beta') - y_axes.remove('mtp_angle_r') - y_axes.remove('mtp_angle_l') + if 'knee_angle_r_beta' in y_axes: + y_axes.remove('knee_angle_r_beta') + if 'knee_angle_l_beta' in y_axes: + y_axes.remove('knee_angle_l_beta') + if 'mtp_angle_r' in y_axes: + y_axes.remove('mtp_angle_r') + if 'mtp_angle_l' in y_axes: + y_axes.remove('mtp_angle_l') # Create results dictionnary. results = { diff --git a/squat_analysis/function/handler.py b/squat_analysis/function/handler.py index 1ceca80..fd481fb 100644 --- a/squat_analysis/function/handler.py +++ b/squat_analysis/function/handler.py @@ -141,10 +141,14 @@ def handler(event, context): # Available options for line curve chart. y_axes = list(colNames) y_axes.remove('time') - y_axes.remove('knee_angle_r_beta') - y_axes.remove('knee_angle_l_beta') - y_axes.remove('mtp_angle_r') - y_axes.remove('mtp_angle_l') + if 'knee_angle_r_beta' in y_axes: + y_axes.remove('knee_angle_r_beta') + if 'knee_angle_l_beta' in y_axes: + y_axes.remove('knee_angle_l_beta') + if 'mtp_angle_r' in y_axes: + y_axes.remove('mtp_angle_r') + if 'mtp_angle_l' in y_axes: + y_axes.remove('mtp_angle_l') # Create results dictionary. results = { diff --git a/treadmill_gait_analysis/function/handler.py b/treadmill_gait_analysis/function/handler.py index 27b91e7..8c02074 100644 --- a/treadmill_gait_analysis/function/handler.py +++ b/treadmill_gait_analysis/function/handler.py @@ -208,10 +208,14 @@ def handler(event, context): # Available options for line curve chart. y_axes = list(colNames) y_axes.remove('time') - y_axes.remove('knee_angle_r_beta') - y_axes.remove('knee_angle_l_beta') - y_axes.remove('mtp_angle_r') - y_axes.remove('mtp_angle_l') + if 'knee_angle_r_beta' in y_axes: + y_axes.remove('knee_angle_r_beta') + if 'knee_angle_l_beta' in y_axes: + y_axes.remove('knee_angle_l_beta') + if 'mtp_angle_r' in y_axes: + y_axes.remove('mtp_angle_r') + if 'mtp_angle_l' in y_axes: + y_axes.remove('mtp_angle_l') # Create results dictionnary. results = {