Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing postseason games? #258

Open
ghost opened this issue Aug 30, 2017 · 6 comments
Open

Missing postseason games? #258

ghost opened this issue Aug 30, 2017 · 6 comments

Comments

@ghost
Copy link

ghost commented Aug 30, 2017

Could anyone elucidate if they have a similar issue as me?

If I run the following code:

for year in range(2009,2017):
db = nfldb.connect()
q = nfldb.Query(db)
print "games played in ", year, ": ", len(q.game(season_type='Postseason', season_year=year).as_games())

which tells me how many postseason games were played, I get the following:

games played in 2009 : 11
games played in 2010 : 11
games played in 2011 : 11
games played in 2012 : 11
games played in 2013 : 11
games played in 2014 : 11
games played in 2015 : 5
games played in 2016 : 0

If search for regular season games, the numbers all match up.

Can I conclude the DB is missing the postseason? I've update the database with nfldb-update (after fixing the JAX and LAC issue) and the problem persists.

Cheers!

@ochawkeye
Copy link
Contributor

For 2015, you are missing the six games in nflgame\schedule.json referenced here: PR#256

For 2016, probably a case where your schedule was not updated while the postseason was in progress.

Maybe the easiest way to fix this is to replace your schedule.json with mine.

@ghost
Copy link
Author

ghost commented Aug 30, 2017

Thanks for the prompt response. I ended up rebuilding the 2015 and 2016 schedules as mentioned in another post, and it appears to be working well. I'll be sure to look at closed issues before posting next time (this is my first time using Git and I only looked at the open ones).

@ochawkeye
Copy link
Contributor

I'll be sure to look at closed issues before posting next time (this is my first time using Git and I only looked at the open ones).

Not your fault. Presumably when issues get "closed" that means the issue has gone away. With the packaged version of some of these files being so dated, though, some of those old issue tend to crop back up on new installations.

@ghost
Copy link
Author

ghost commented Aug 30, 2017

So I've run nflgame's update-players and it works fine. When I run this though:

db = nfldb.connect()
q = nfldb.Query(db)
jay = q.player(full_name="Jay Cutler").as_players()[0]
print jay

Jay Cutler is listed as being Chicago's QB, when he was recently traded to Miami. Do I need to take some steps for compatibility between running the nflgame update-players and accessing the database?

@ghost
Copy link
Author

ghost commented Aug 30, 2017

If anyone stumbles on this later, you can solve the above issue by resetting the last_roster_download metadata in the DB as follows. Then when you run nfldb-update, it will pull the correct roster using nflgame. To get the info into the DB, it's not enough to just run update-players on the nflgame side.

psql nfldb -c "SET TIME ZONE 'UTC'; UPDATE meta SET last_roster_download = '2000-01-01 00:00:00+00';"

@ochawkeye
Copy link
Contributor

ochawkeye commented Aug 30, 2017

Referencing Jay Cutler in a thread about postseason anything is probably where part of your problem lies. 😏
But as you mention, an nfldb-update has to happen to update nfldb. By default, the nflgame update will only occur once every twelve hours unless you tell it otherwise. You can do this with --player-interval 0 to force a player update.

import nfldb
db = nfldb.connect()
q = nfldb.Query(db)
jay = q.player(full_name="Jay Cutler").as_players()[0]
print jay
Jay Cutler (MIA, QB)

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

No branches or pull requests

1 participant