Skip to content

Commit 0e3388a

Browse files
committed
added github actions yml
1 parent 41ca643 commit 0e3388a

File tree

1,546 files changed

+84772
-3
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,546 files changed

+84772
-3
lines changed

.github/workflows/main.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: temp name
2+
3+
on:
4+
push:
5+
branches: [ "main", "dev" ]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
python-version: ["3.9", "3.10", "3.11"]
14+
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v3
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
python -m pip install flake8 pytest
25+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
26+
27+
run-main:
28+
runs-on: ubuntu-latest
29+
needs: build
30+
31+
steps:
32+
- uses: actions/checkout@v4
33+
- name: Set up Python
34+
uses: actions/setup-python@v3
35+
with:
36+
python-version: "3.10" # Specify one Python version for `run-main`
37+
- name: Run main handler
38+
run: |
39+
python code/main_handler.py all
-5 Bytes
Binary file not shown.
190 Bytes
Binary file not shown.

code/data_processing/save_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class SAVE_EVERYTHING:
66
def __init__(self):
7-
self.datadir = './data/test'
7+
self.datadir = './data'
88
self.sessions = {} # Dictionary to track session numbers for each subjectID
99

1010
def _get_folder(self, subjID):

code/data_processing/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import pandas as pd
44
import numpy as np
55

6+
from termcolor import cprint
67

78
class CONVERT_TO_CSV:
89
def __init__(self, task, init_path='./data/raw'):
@@ -20,8 +21,12 @@ def convert_to_csv(self, txt_dfs):
2021
tweets = []
2122

2223
for line in lines:
24+
print(line)
2325
if line.strip():
24-
tweets.append(json.loads(line))
26+
try:
27+
tweets.append(json.loads(line))
28+
except json.JSONDecodeError as e:
29+
cprint(f"JSONDecodeError: {e} on line: {line}", 'red')
2530

2631
if not tweets:
2732
# If file is empty or has no valid lines, skip

code/main_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def pull(self, task):
3838
proxy=False
3939
)
4040

41-
txt_dfs = pull_instance.load(days_ago=32)
41+
txt_dfs = pull_instance.load(days_ago=127)
4242
return self.convert_to_csv(txt_dfs, task)
4343

4444
def convert_to_csv(self, txt_dfs, task):

data/int/NE/9002/AF/data/9002_ses-1_cat-1.csv

Lines changed: 145 additions & 0 deletions
Large diffs are not rendered by default.

data/int/NE/9002/AF/data/9002_ses-3_cat-1.csv

Lines changed: 145 additions & 0 deletions
Large diffs are not rendered by default.
18.2 KB
Loading
41 KB
Loading

0 commit comments

Comments
 (0)