From 4dd670b8f110634a81b2cb127d852f7fb99eb88d Mon Sep 17 00:00:00 2001 From: Skudalen Date: Fri, 25 Jun 2021 10:52:33 +0200 Subject: [PATCH] fix: fix the load func --- Handle_emg_data.py | 21 ++++++++++++--------- Test_functions.py | 2 +- __pycache__/Handle_emg_data.cpython-38.pyc | Bin 11430 -> 12007 bytes 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Handle_emg_data.py b/Handle_emg_data.py index ee03c45..852ff06 100644 --- a/Handle_emg_data.py +++ b/Handle_emg_data.py @@ -64,7 +64,7 @@ class CSV_handler: # Links the retrieved data with the subjects data_container subject_nr = data_container.subject_nr self.data_container_dict[subject_nr] = data_container - print(data_container.subject_name) + #print(data_container.subject_name) # Loads the data from the csv files into a storing system in an CSV_handler object def load_hard_PP_emg_data(self): @@ -135,24 +135,27 @@ class CSV_handler: subject1_data_container = Data_container(1, 'HaluskaMarek') - #print(subject1_data_container.data_dict_round1) - subject2_data_container = Data_container(1, 'HaluskaMaros') - subject3_data_container = Data_container(1, 'HaluskovaBeata') - subject4_data_container = Data_container(1, 'KelisekDavid') - subject5_data_container = Data_container(1, 'KelisekRichard') + subject2_data_container = Data_container(2, 'HaluskaMaros') + subject3_data_container = Data_container(3, 'HaluskovaBeata') + subject4_data_container = Data_container(4, 'KelisekDavid') + subject5_data_container = Data_container(5, 'KelisekRichard') subject_data_container_list = [subject1_data_container, subject2_data_container, subject3_data_container, subject4_data_container, subject5_data_container] for subject_nr in range(5): + data_container = subject_data_container_list[subject_nr] # left variant proccessed here for round in range(4): for emg_nr in range(8): - self.store_df(left_list[subject_nr][round], emg_nr, 'left', subject_data_container_list[subject_nr], round+1) + filename = left_list[subject_nr][round] + self.store_df_in_container(filename, emg_nr, 'left', data_container, round+1) # right variant proccessed here for round in range(4): for emg_nr in range(8): - self.store_df(right_list[subject_nr][round], emg_nr, 'right', subject_data_container_list[subject_nr], round+1) - + filename = right_list[subject_nr][round] + self.store_df_in_container(filename, emg_nr, 'left', data_container, round+1) + # Links the stored data in the data_container to the Handler + self.link_container_to_handler(data_container) return self.data_container_dict def load_hard_original_emg_data(self): diff --git a/Test_functions.py b/Test_functions.py index 6321cdf..ddeae15 100644 --- a/Test_functions.py +++ b/Test_functions.py @@ -15,7 +15,7 @@ def test_load_func(): handler = CSV_handler() test_dict = handler.load_hard_PP_emg_data() subject2_container = test_dict.get(2) - print(subject2_container) + #print(subject2_container) print(subject2_container.data_dict_round1.get('left')[1]) def test_min_max_func(): diff --git a/__pycache__/Handle_emg_data.cpython-38.pyc b/__pycache__/Handle_emg_data.cpython-38.pyc index 1f3307030094ea9d27bcf42805b98577019ccdd0..2134b005adddfed974d4b3da5571d3c8ea7ecd06 100644 GIT binary patch delta 2683 zcmaKuT~8cU7{}+#?9Q$WY=Q2wz#=UbYnRu;vb-)YEm*O&tu3|+7KbTkfqij-GXoei z+l`?g06jOo-~u%1l{bbj;Dxs&jmE@mjM{i%jEV8e3lpQyGdnvBxCoiwobx~b^E~He zX3jpH{bk;Nud2!?z~A#H-!5!Te&KgZWPt~yE3FAHt=J{Bl2$!-&H1RGo_Q?HRnTf$ z1NTZ=J0nES9;Btu#JmT(yWyIIOZy&R2z!D-43UzMurKCh!%azAWD|x&MYvx!WW$vr zRBR9oF)plsXVs-*J^KXwF7T~c{spsLJmD9q<)_&d=-`G9dsc@XvjZeMmOv_X$PR*E z2LCh5|E1}7o$$MCzgKtj3eUJKvsRcLS3NDn!?!)He52#cOF>OvWeJ5YDaov|xSG|~ zWHwSIq z?%=H}}iXQvx7 z$!z*)=!(8t8sj*aG#Ma>GVzfQUv`fFKfU;x6!cGkxdJY8u;&k2nx;s;opx-Cxqe-s zowN%|15oOwm!UKWr5@S~r6D6`^cw@lpfR-U&JF8?_H2_WVSYC^VhkH24MHvsTDPeU z=0>3$HOrTBV@4F)jZyH7!=on}J_g=hP5={~yAP@B>8n z8WKoGd>_^tY6k3p3toiSE&lvM6W{ZN`J;0(&oo!^Ltj7tyt($^(D$b=&myoQh019) z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