Skip to content

Commit ffc7f47

Browse files
committed
removed a ridiculous amount of print statements (debug) and gave privs for actions bot to push changes
1 parent 6bbd702 commit ffc7f47

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

.github/workflows/main.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,14 @@ jobs:
1919
python -m pip install --upgrade pip
2020
python -m pip install flake8 pytest
2121
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
22+
- name: Run Python script
23+
run: |
2224
python code/main_handler.py all
25+
- name: Commit and push changes to dev
26+
run: |
27+
git config --global user.name "GitHub Actions Bot"
28+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
29+
git checkout dev
30+
git add .
31+
git commit -m "Automated changes from GitHub Actions"
32+
git push origin dev

code/data_processing/pull_handler.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ def load(self, days_ago=1):
5555
response = requests.post(url, headers=headers, json=data, proxies=proxies)
5656
response.raise_for_status() # Raise HTTP errors if any
5757
response_json = response.json()
58-
print(f"""raw response from Jatos:
59-
{response_json}""")
6058

6159
# Extract and filter study results
6260
study_result_ids = [
@@ -82,8 +80,6 @@ def load(self, days_ago=1):
8280
response = requests.post(url, headers=headers, json=data) #proxies=proxies) DONT USE THAT THANG
8381
response.raise_for_status() # Raise HTTP errors if any
8482
response_json = response.json()
85-
print(f"""raw response from Jatos:
86-
{response_json}""")
8783

8884
# Extract and filter study results
8985
study_result_ids = [
@@ -165,7 +161,6 @@ def _extract_txt_files(self, zip_content, study_result_ids):
165161
df = pd.DataFrame({"file_content": [file_data]}) # Create a DataFrame for this file
166162
data_frames.append(df)
167163

168-
print(f"Extracted {len(data_frames)} .txt files.")
169164
return data_frames # List of DataFrames
170165

171166

code/data_processing/save_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import os
22
import pandas as pd
33
import matplotlib.pyplot as plt
4+
from termcolor import cprint
45

56
class SAVE_EVERYTHING:
67
def __init__(self):
@@ -17,6 +18,7 @@ def _get_folder(self, subjID):
1718

1819
def save_dfs(self, categories, task):
1920
for subjectID, category, df in categories:
21+
cprint(f"saving {subjectID}...", "green")
2022
folder1, folder2 = self._get_folder(subjectID)
2123
outdir = os.path.join(self.datadir, folder1, folder2, str(subjectID), task, 'data')
2224
session = df['session_number'][2]

code/main_handler.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ def qc_cc_dfs(self, dfs, task):
8484
print(f"Category = {category}")
8585
categories.append([subject, category, df])
8686
plots.append([subject, plot])
87-
print(categories)
8887

8988
else:
9089
qc_instance = CCqC(task,
@@ -102,7 +101,6 @@ def qc_cc_dfs(self, dfs, task):
102101
print(f"Category = {category}")
103102
categories.append([subject, category, df])
104103
plots.append([subject, plot])
105-
print(categories)
106104
save_instance = SAVE_EVERYTHING()
107105
save_instance.save_dfs(categories=categories,
108106
task=task)
@@ -202,10 +200,8 @@ def qc_wl_dfs(self, dfs, task):
202200
dwl_instance = WL_QC()
203201
print(f"qcing {subject}")
204202
df_all, category = dwl_instance.dwl_qc(df, version)
205-
print(df_all.head())
206203
plot = plot_instance.dwl_plot(df_all)
207204
print(f"Category = {category}")
208-
print(df_all.head())
209205
categories.append([subject, category, df])
210206
plots.append([subject, plot])
211207
save_instance = SAVE_EVERYTHING()

0 commit comments

Comments
 (0)