Skip to content

Commit 8a9a3fb

Browse files
committed
feat: re integrated gha and pre commit workflow hooks deleted from improper branching
1 parent 9e1f5d5 commit 8a9a3fb

3 files changed

Lines changed: 93 additions & 22 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Convert Notebooks to Markdown
2+
on:
3+
push:
4+
paths: ['**.ipynb']
5+
jobs:
6+
convert:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: write
10+
steps:
11+
- uses: actions/checkout@v3
12+
13+
- name: Set up Python
14+
uses: actions/setup-python@v4
15+
with:
16+
python-version: '3.x'
17+
18+
- name: Install jupyter
19+
run: pip install jupyter
20+
21+
- name: Convert notebooks to markdown
22+
run: |
23+
find . -name "*.ipynb" ! -name "*.working.ipynb" ! -name "*.dev.ipynb" -exec jupyter nbconvert --to markdown {} \;
24+
25+
- name: Commit files
26+
run: |
27+
git config --local user.email "chris@trau.co"
28+
git config --local user.name "iTrauco"
29+
git add -A
30+
git commit -m "Convert notebooks to markdown" || echo "No changes to commit"
31+
git push

notebooks/machine_learning/preprocessing/01b_preprocessing_frame_diff.ipynb

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
},
6464
{
6565
"cell_type": "code",
66-
"execution_count": 24,
66+
"execution_count": 33,
6767
"id": "e191c2f4-5ae4-441e-be01-2457e823f9c4",
6868
"metadata": {},
6969
"outputs": [
@@ -122,17 +122,17 @@
122122
},
123123
{
124124
"cell_type": "code",
125-
"execution_count": 25,
125+
"execution_count": 34,
126126
"id": "ac0da4d7-ec44-4bab-b09c-4b78c2877f8e",
127127
"metadata": {},
128128
"outputs": [
129129
{
130130
"name": "stdout",
131131
"output_type": "stream",
132132
"text": [
133-
"✓ Base clip: data/clips/ATL-0610_60s_20250624_174155.mp4\n",
134-
"✓ Frames dir: data/frames/ATL-0610_20250624_174155\n",
135-
"✓ Timestamp: 20250624_174155\n"
133+
"✓ Base clip: data/clips/ATL-0610_60s_20250624_175029.mp4\n",
134+
"✓ Frames dir: data/frames/ATL-0610_20250624_175029\n",
135+
"✓ Timestamp: 20250624_175029\n"
136136
]
137137
}
138138
],
@@ -167,15 +167,15 @@
167167
},
168168
{
169169
"cell_type": "code",
170-
"execution_count": 26,
170+
"execution_count": 35,
171171
"id": "141b705f-b8e5-4e57-addf-143ad6c2f4ac",
172172
"metadata": {},
173173
"outputs": [
174174
{
175175
"name": "stdout",
176176
"output_type": "stream",
177177
"text": [
178-
"✓ Moved 129 frames to: data/frames/ATL-0610_20250624_174155/original\n"
178+
"✓ Moved 129 frames to: data/frames/ATL-0610_20250624_175029/original\n"
179179
]
180180
}
181181
],
@@ -239,7 +239,7 @@
239239
},
240240
{
241241
"cell_type": "code",
242-
"execution_count": 27,
242+
"execution_count": 36,
243243
"id": "767d3689-9d5e-4bec-a95b-cc053b99165a",
244244
"metadata": {},
245245
"outputs": [
@@ -248,8 +248,8 @@
248248
"output_type": "stream",
249249
"text": [
250250
"✓ Processed 128 frames\n",
251-
"✓ Frames saved: data/frames/ATL-0610_20250624_174155/frame_diff_basic\n",
252-
"✓ Clip saved: data/clips/ATL-0610_basic_diff_20250624_174155.mp4\n"
251+
"✓ Frames saved: data/frames/ATL-0610_20250624_175029/frame_diff_basic\n",
252+
"✓ Clip saved: data/clips/ATL-0610_basic_diff_20250624_175029.mp4\n"
253253
]
254254
},
255255
{
@@ -451,7 +451,7 @@
451451
},
452452
{
453453
"cell_type": "code",
454-
"execution_count": 28,
454+
"execution_count": 37,
455455
"id": "497c7b05-8ffe-440b-8327-35927919b63d",
456456
"metadata": {},
457457
"outputs": [
@@ -461,8 +461,8 @@
461461
"text": [
462462
"✓ Processed 128 annotation frames\n",
463463
"✓ Processed 898 video frames\n",
464-
"✓ Frames saved: data/frames/ATL-0610_20250624_174155/frame_diff_moderate\n",
465-
"✓ Clip saved: data/clips/ATL-0610_moderate_diff_20250624_174155.mp4\n"
464+
"✓ Frames saved: data/frames/ATL-0610_20250624_175029/frame_diff_moderate\n",
465+
"✓ Clip saved: data/clips/ATL-0610_moderate_diff_20250624_175029.mp4\n"
466466
]
467467
},
468468
{
@@ -688,7 +688,7 @@
688688
},
689689
{
690690
"cell_type": "code",
691-
"execution_count": 29,
691+
"execution_count": 38,
692692
"id": "eadf9c08-44f3-4784-a0da-70f0675a75b7",
693693
"metadata": {},
694694
"outputs": [
@@ -698,8 +698,8 @@
698698
"text": [
699699
"✓ Processed 128 annotation frames\n",
700700
"✓ Processed 898 video frames\n",
701-
"✓ Frames saved: data/frames/ATL-0610_20250624_174155/frame_diff_advanced\n",
702-
"✓ Clip saved: data/clips/ATL-0610_advanced_diff_20250624_174155.mp4\n"
701+
"✓ Frames saved: data/frames/ATL-0610_20250624_175029/frame_diff_advanced\n",
702+
"✓ Clip saved: data/clips/ATL-0610_advanced_diff_20250624_175029.mp4\n"
703703
]
704704
},
705705
{
@@ -911,7 +911,7 @@
911911
},
912912
{
913913
"cell_type": "code",
914-
"execution_count": 30,
914+
"execution_count": 39,
915915
"id": "35a6e4f4-2bb5-4115-9097-13c1f4852290",
916916
"metadata": {},
917917
"outputs": [
@@ -1018,15 +1018,15 @@
10181018
},
10191019
{
10201020
"cell_type": "code",
1021-
"execution_count": 31,
1021+
"execution_count": 40,
10221022
"id": "7d471085-f6f7-4e6e-8c77-45b748e02d92",
10231023
"metadata": {},
10241024
"outputs": [
10251025
{
10261026
"name": "stdout",
10271027
"output_type": "stream",
10281028
"text": [
1029-
"✓ Annotation config saved: configs/annotation_config_20250624_174155.json\n",
1029+
"✓ Annotation config saved: configs/annotation_config_20250624_175029.json\n",
10301030
"✓ Frame formats: 4\n",
10311031
"✓ Clip formats: 4\n",
10321032
"✓ Total frames per format: 129\n",
@@ -1116,15 +1116,15 @@
11161116
},
11171117
{
11181118
"cell_type": "code",
1119-
"execution_count": 32,
1119+
"execution_count": 41,
11201120
"id": "d4e0299f-0cc8-474e-9124-263bb8c42558",
11211121
"metadata": {},
11221122
"outputs": [
11231123
{
11241124
"name": "stdout",
11251125
"output_type": "stream",
11261126
"text": [
1127-
"✓ Project summary: configs/project_summary_20250624_174155.json\n",
1127+
"✓ Project summary: configs/project_summary_20250624_175029.json\n",
11281128
"✓ Ready for annotation phase\n"
11291129
]
11301130
}
@@ -1185,7 +1185,7 @@
11851185
},
11861186
{
11871187
"cell_type": "code",
1188-
"execution_count": 22,
1188+
"execution_count": 42,
11891189
"id": "61ce083f-adb7-4550-987a-3f4d32be4fe2",
11901190
"metadata": {},
11911191
"outputs": [

scripts/setup_dev_hooks.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash
2+
3+
# dev hooks installer
4+
# installs gha + precommit
5+
6+
# colors
7+
RED='\033[0;31m'
8+
GREEN='\033[0;32m'
9+
YELLOW='\033[1;33m'
10+
BLUE='\033[0;34m'
11+
NC='\033[0m'
12+
13+
# paths
14+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
15+
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
16+
17+
# gist urls
18+
GHA_WORKFLOW_GIST="https://gist.githubusercontent.com/iTrauco/858f9af3ffccac1cd5f8d5388513a85e/raw"
19+
PRECOMMIT_HOOK_GIST="https://gist.githubusercontent.com/iTrauco/3c273475bc24da230bb6b1cb3d86b62f/raw"
20+
21+
echo -e "${BLUE}[DEV SETUP] Installing precommit + GitHub Actions...${NC}"
22+
23+
# check .git
24+
if [ ! -d "$PROJECT_ROOT/.git" ]; then
25+
echo -e "${RED}❌ No .git repo found at $PROJECT_ROOT${NC}"
26+
exit 1
27+
fi
28+
29+
# install gha
30+
mkdir -p "$PROJECT_ROOT/.github/workflows"
31+
curl -s "$GHA_WORKFLOW_GIST" > "$PROJECT_ROOT/.github/workflows/notebook_to_markdown.yml"
32+
echo -e "${GREEN}✅ GitHub Actions workflow installed${NC}"
33+
34+
# install precommit
35+
mkdir -p "$PROJECT_ROOT/.git/hooks"
36+
curl -s "$PRECOMMIT_HOOK_GIST" > "$PROJECT_ROOT/.git/hooks/pre-commit"
37+
chmod +x "$PROJECT_ROOT/.git/hooks/pre-commit"
38+
echo -e "${GREEN}✅ Pre-commit hook installed${NC}"
39+
40+
echo -e "${BLUE}Done.${NC}"

0 commit comments

Comments
 (0)