Skip to content

Commit 1c4f0bf

Browse files
committed
Changes for actions friendly container
1 parent 9d1b7f8 commit 1c4f0bf

File tree

7 files changed

+13
-8
lines changed

7 files changed

+13
-8
lines changed

Diff for: Dockerfile

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,17 @@ RUN apt-get update
44
RUN apt install -y python3 python3-pip
55

66
RUN pip install carball
7+
RUN pip install numpy==1.20.3
78
RUN pip install requests
89
RUN pip install python-dotenv
910
RUN pip install ipykernel
1011
RUN pip install xgboost
1112
RUN pip install scikit-learn
1213
RUN pip install progress
1314
RUN pip install wrapt_timeout_decorator
15+
RUN pip install matplotlib tabulate astropy colorama
1416

15-
WORKDIR /src
17+
WORKDIR /app/src
1618

1719
CMD python3 replay.py && python3 convert.py && cd xg_model && python3 -c "from score import convert_all; convert_all()" && cd .. && python3 csv_trimmer.py && python3 boxcarstest.py
1820
# && python3 boxcars_dev.py

Diff for: data/charts/full_canvas.png

0 Bytes
Loading

Diff for: data/charts/latest_streak/full_canvas.png

0 Bytes
Loading

Diff for: data/json/97ddb298-f27a-4341-8adf-a29585f8fcc4.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -806,10 +806,10 @@
806806
{
807807
"playerIds": [
808808
{
809-
"id": "bf81d8692db"
809+
"id": "76561198039309853"
810810
},
811811
{
812-
"id": "76561198039309853"
812+
"id": "bf81d8692db"
813813
}
814814
],
815815
"score": 5,

Diff for: docker-compose.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ services:
77
- LANG=C.UTF-8
88
env_file: .env
99
volumes:
10-
- ./data:/data
11-
- ./src:/src
10+
- .:/app

Diff for: src/boxcarstest.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
from numpy.lib.stride_tricks import sliding_window_view
3333
from colorama import Fore, Back, Style
3434
from PIL import Image
35+
import glob
36+
from pathlib import Path
3537

3638
startTime = time.time()
3739

@@ -1536,8 +1538,10 @@ def poisson_probability(actual, mean):
15361538
res_num += 1
15371539

15381540
# Clear json_new directory
1539-
shutil.rmtree("../data/json_new/")
1540-
os.makedirs("../data/json_new/")
1541+
all_files = glob.glob('../data/json_new/*.json')
1542+
for f in all_files:
1543+
os.unlink(f)
1544+
Path("../data/json_new").mkdir(parents=True, exist_ok=True)
15411545

15421546
# Copy most recent streak games to /json_new/
15431547
for file in streak_filenames[len(streak_filenames) - 1]:

Diff for: src/xg_model/score.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def score_game(self, game_id):
5151
print(e)
5252
return
5353
shots['xg'] = xg
54-
print(shots)
54+
# print(shots)
5555
print(shots.groupby('shot_taker_name')['xg'].sum())
5656

5757
e = shots[['shot_taker_name', 'is_orange', 'time', 'xg', 'shot', 'goal']].copy()

0 commit comments

Comments
 (0)