Skip to content

Commit

Permalink
Add analysze data.
Browse files Browse the repository at this point in the history
  • Loading branch information
barbacbd committed Jul 18, 2024
1 parent 7f5cdf8 commit 37a6048
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/nhl_model/ann.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def findGamesByDate(day, month, year):
return None

if "games" not in todaysGameData or len(todaysGameData["games"]) == 0:
logger.error(f"no games foud for today {searchDate}")
logger.error(f"no games found for today {searchDate}")
return None

return todaysGameData
Expand Down
10 changes: 8 additions & 2 deletions src/nhl_model/exec.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import argparse
from datetime import datetime
from logging import getLogger, basicConfig
from nhl_model.ann import execAnn, findFiles, execAnnSpecificDate
from nhl_model.dataset import generateDataset, pullDatasetNewAPI
from nhl_model.ann import execAnn, findFiles, execAnnSpecificDate, determineWinners
from nhl_model.dataset import generateDataset
from nhl_model.poisson import execPoisson


Expand Down Expand Up @@ -68,6 +68,10 @@ def main():
'-y', '--year', help='Year for prediction', default=datetime.now().year
)

mainSubParsers.add_parser(
'analyze', help='Analyze the output file and set the winner information.'
)

args = parser.parse_args()

# set the logger
Expand All @@ -79,6 +83,8 @@ def main():
if args.execType == 'generate':
validFiles = findFiles(args.version, args.startYear, args.endYear)
generateDataset(args.version, args.startYear, args.endYear, validFiles=validFiles)
elif args.execType == 'analyze':
determineWinners()
elif args.execType == 'ann':
execAnn(args.override)
elif args.execType == 'poisson':
Expand Down

0 comments on commit 37a6048

Please sign in to comment.