Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mpope9
Copy link
Owner

@mpope9 mpope9 commented Nov 22, 2021

For issue: #63

This PR adds the concept of 'modes'.
The existing method of creating the database will be determined by using the --default-mode commandline flag.

The new 'mode' that is introduced is updating the current season. This is specified by the --current_season_mode commandline switch. These are mutually exclusive groups in Gooey. This takes an existing database, loads all player_game_log entries into a temp table, then uses this new temp table (which should have more games than the existing player_game_log table) then uses set logic through an EXCEPT query to determine which games are new. This is used to update tables like game, shot_chart_detail, and player_game_log.

TODOs:

  • If no new games are added, bail early.
    • Do this by evaluating the EXCEPT predicate early.
  • Temp table creation atm conflicts with creating a fresh DB. The dependent objects do not yet exist.
    • Could be fixed by checking the current mode, if it was stored in the settings object.
    • Confirm that this is still broken after other changes before implementing.
  • Expand what is stored in the Settings class.
    • We're passing alot of cmd line args to the different mode functions.
    • If they were stored in Settings it'd be easier.
  • Move schema create function to db_utils.
  • Evaluate temp table indexes
    • Most probably aren't needed?
  • Figure out debug logging flags.
    • Would be useful to diagnose bugs by looking at the peewee queries.

@mpope9
Copy link
Owner Author

mpope9 commented Nov 22, 2021

Passing the filter predicate to the shot_chart_detail finalize is...a bit messy? I'm not sure, while it seems like the most flexible way to support filtering on the temp table -> regular table insert I'm not sure if it will work in future contexts, if there are any...

@mpope9 mpope9 merged commit 63b6d8f into master Dec 13, 2021
@mpope9 mpope9 deleted the current-season branch December 13, 2021 00:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants