-
Notifications
You must be signed in to change notification settings - Fork 0
/
createpickles.py
33 lines (30 loc) · 952 Bytes
/
createpickles.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""
Create the initial pickle files for testing
"""
import pickle
from satchel.model import Satchel
from pathlib import Path
schedule2021 = Path("satchel", "schedules", "schedule2021.csv")
batter_projections = Path("satchel", "data", "batterprojections_test.csv")
pitcher_projections = Path("satchel", "data", "pitcherprojections_test.csv")
s1 = Satchel(
seed=123,
schedule=schedule2021,
batter_proj=batter_projections,
pitcher_proj=pitcher_projections,
use_current_results=False,
cache=False,
)
r1 = s1.simulate(100)
s2 = Satchel(
seed=123,
transactions={"10954": {"team": "HOU", "date": "2021-04-01"}},
schedule=schedule2021,
batter_proj=batter_projections,
pitcher_proj=pitcher_projections,
use_current_results=False,
cache=False,
)
r2 = s2.simulate(100)
pickle.dump(r1, Path("satchel", "tests", "basesim.p").open("wb"))
pickle.dump(r2, Path("satchel", "tests", "transactionsim.p").open("wb"))