Skip to content

Commit 5f60f4f

Browse files
author
Jakub Sliacan
committed
gha: process box files
1 parent 1055918 commit 5f60f4f

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

.github/workflows/box.yml

+21
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ on:
66
pull_request: {}
77

88
jobs:
9+
<<<<<<< Updated upstream
910
read-data:
11+
=======
12+
process-box-files:
13+
>>>>>>> Stashed changes
1014
runs-on: ubuntu-latest
1115
steps:
1216
- name: Checkout repository
@@ -16,12 +20,29 @@ jobs:
1620
uses: actions/setup-python@v4
1721
with:
1822
python-version: '3.x'
23+
<<<<<<< Updated upstream
1924
cache: 'pip3'
2025
run: pip3 install -r requirements.txt
2126

2227
- name: Process CSV files
2328
run: |
2429
python gha/process-box.py
30+
=======
31+
- name: Install requirements
32+
run: |
33+
pip3 install networkx
34+
pip3 install matplotlib
35+
36+
- name: Process CSV files
37+
run: |
38+
# copy up one dir so imports work
39+
cp gha/process-box.py .
40+
python process-box.py
41+
42+
- name: Package artifacts
43+
run: |
44+
zip -r ot-figures.zip gha/out/ot-figures/
45+
>>>>>>> Stashed changes
2546

2647
- name: Upload OT figures
2748
uses: actions/upload-artifact@v4

gha/process-box.py

+21
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
<<<<<<< Updated upstream
12
import os
3+
=======
4+
import os, sys
5+
#sys.path.append("..")
6+
>>>>>>> Stashed changes
27
import matplotlib.pyplot as plt
38
import networkx as nx
49
from src import box, constants, util
@@ -9,6 +14,11 @@
914
util.ensure_date_in_filenames(dflist)
1015
dflist = util.get_box_files(bikeLogs)
1116

17+
<<<<<<< Updated upstream
18+
=======
19+
ot_events = []
20+
21+
>>>>>>> Stashed changes
1222
for csv_file in dflist:
1323
print(csv_file, flush=True)
1424
csvr = util.read_csv(csv_file)
@@ -17,7 +27,10 @@
1727
press_starts, press_lengths = box.get_press_lengths_and_starts(ldata)
1828
date_string = csv_file.split("/")[-1][:8]
1929

30+
<<<<<<< Updated upstream
2031
"""
32+
=======
33+
>>>>>>> Stashed changes
2134
b_partitions, a_partitions, b_modularities, a_modularities = mod.get_partitions(ldata, press_starts, press_lengths)
2235
2336
for j, b_parts in enumerate(b_partitions):
@@ -85,9 +98,17 @@
8598
break # after getting to the OT event
8699
87100
plt.ylim([0,700])
101+
<<<<<<< Updated upstream
88102
plt.savefig(os.path.join("out", "mod", date_string+"_ld_"+str(press_starts[j])+"_"+"{:.6f}".format(pmod)+"_disp="+str(dispersion_score)+"_clique.png"))
89103
plt.clf()
90104
91105
util.write_to_csv_file(os.path.join("data", "ot_events.csv"), ot_events)
92106
93107
"""
108+
=======
109+
plt.savefig(os.path.join("gha", "out", "ot-figures", date_string+"_ld_"+str(press_starts[j])+"_"+"{:.6f}".format(pmod)+"_disp="+str(dispersion_score)+"_clique.png"))
110+
plt.clf()
111+
112+
util.write_to_csv_file(os.path.join("gha", "out", "ot-events.csv"), ot_events)
113+
114+
>>>>>>> Stashed changes

0 commit comments

Comments
 (0)