Code Monkey home page Code Monkey logo

Comments (7)

nickfrerichs avatar nickfrerichs commented on July 16, 2024

What do you see when you run livestats.py -hello ?

from fflproject.

bubbajones69 avatar bubbajones69 commented on July 16, 2024

from fflproject.

nickfrerichs avatar nickfrerichs commented on July 16, 2024

Edit livestats.py, on line 510 (line before cur.execute(query)), add print query. Then run it and let me know what the output looks like.

from fflproject.

bubbajones69 avatar bubbajones69 commented on July 16, 2024

here is output for week 1

python livestats.py -week 1 -all -recalc_all
Udpating NFL Statistics (2017-09-22 12:23:48)

Reading NFL stats for Week 1
Got all games
--- 0.299476861954 seconds ---

KC (42) at NE (27) - Q: Final, 00:39
NYJ (12) at BUF (21) - Q: Final, 00:39
ATL (23) at CHI (17) - Q: Final, 00:03
BAL (20) at CIN (0) - Q: Final, 00:25
PIT (21) at CLE (18) - Q: Final, 00:36
ARI (23) at DET (35) - Q: Final, 00:18
JAX (29) at HOU (7) - Q: Final, 00:32
OAK (26) at TEN (16) - Q: Final, 00:07
PHI (30) at WAS (17) - Q: Final, 00:25
IND (9) at LA (46) - Q: Final, 00:00
SEA (9) at GB (17) - Q: Final, 00:39
CAR (23) at SF (3) - Q: Final, 00:25
NYG (3) at DAL (19) - Q: Final, 00:04
NO (19) at MIN (29) - Q: Final, 00:28
LAC (21) at DEN (24) - Q: Final, 00:01
Purged 0 nfl_statistic rows.
--- 5.74099588394 seconds ---

Calculating and storing fantasy values


****** 6596 fantasy_statistics to calculate


select scoring_def.nfl_scoring_cat_id, per, points, round, is_range, range_start, range_end, nfl_position_id from scoring_def join nfl_scoring_cat on nfl_scoring_cat.id = scoring_def.nfl_scoring_cat_id where league_id = 1 and year = 2017
select scoring_def.nfl_scoring_cat_id, per, points, round, is_range, range_start, range_end, nfl_position_id from scoring_def join nfl_scoring_cat on nfl_scoring_cat.id = scoring_def.nfl_scoring_cat_id where league_id = 2 and year = None
Traceback (most recent call last):
File "livestats.py", line 654, in
main()
File "livestats.py", line 46, in main
update_games(year, week, weektype, args.all)
File "livestats.py", line 76, in update_games
update_fantasy_statistics(year, week, weektype)
File "livestats.py", line 432, in update_fantasy_statistics
scoring_def = get_scoring_def_dict(leagueid, year)
File "livestats.py", line 511, in get_scoring_def_dict
cur.execute(query)
File "/usr/lib64/python2.7/site-packages/MySQLdb/cursors.py", line 205, in execute
self.errorhandler(self, exc, value)
File "/usr/lib64/python2.7/site-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.OperationalError: (1054, "Unknown column 'None' in 'where clause'")

This is output when trying week 2:
python livestats.py -week 2 -all -recalc_all
Udpating NFL Statistics (2017-09-22 12:24:43)

Reading NFL stats for Week 2
Traceback (most recent call last):
File "livestats.py", line 654, in
main()
File "livestats.py", line 46, in main
update_games(year, week, weektype, args.all)
File "livestats.py", line 67, in update_games
(live_changes_made, livegamecount) = update_nfl_statistics(year, week, weektype, update_all)
File "livestats.py", line 109, in update_nfl_statistics
games = nflgame.games(int(year), week=int(week), kind=weektype)
File "/usr/lib/python2.7/site-packages/nflgame/init.py", line 229, in games
return list(games_gen(year, week, home, away, kind, started))
TypeError: 'NoneType' object is not iterable

from fflproject.

nickfrerichs avatar nickfrerichs commented on July 16, 2024

It looks like you have two leagues setup and one of them doesn't have any scoring definitions defined. The easiest way for you to get up and running would be to add at least one scoring definition for the league that doesn't have any.

Longer term, I'll fix the bug by updating livestats.py to skip any leagues without scoring definitions.

from fflproject.

bubbajones69 avatar bubbajones69 commented on July 16, 2024

from fflproject.

nickfrerichs avatar nickfrerichs commented on July 16, 2024

This has been fixed and committed to the develop branch.

from fflproject.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.