DimaKudosh / pydfs-lineup-optimizer

Daily Fantasy Sports lineup optimzer for all popular daily fantasy sports sites
MIT License
424 stars 157 forks source link

team stack error #191

Open walkertyler7713 opened 4 years ago

walkertyler7713 commented 4 years ago

Hello All,

First want to say what a great tool you've created, very much appreciate you sharing your work on this

Tool works great outside of the team stack options. I'm sure there is something I'm doing wrong but I cant figure it out from the docs. Can you take a look and advise?

optimizer = get_optimizer(Site.DRAFTKINGS, Sport.BASEBALL) optimizer.load_players_from_csv('Actual Batter.csv') optimizer.restrict_positions_for_opposing_team(['P'], ['C', 'SS', 'OF', '1B', '2B', '3B']) optimizer.set_max_repeating_players(5) optimizer.set_spacing_for_positions(['1B', '2B', '3B', 'OF', 'SS', 'C'], 3) optimizer.add_stack(TeamStack(3)) optimizer.add_stack(TeamStack(3, for_teams=['SD', 'NYY', 'CHC'])) for lineup in optimizer.optimize(n=100, randomness=True, max_exposure=.99, exposure_strategy=AfterEachExposureStrategy): print(lineup) print(lineup.players) # list of players print(lineup.fantasy_points_projection) print(lineup.salary_costs)

NameError Traceback (most recent call last)

in 4 optimizer.set_max_repeating_players(5) 5 optimizer.set_spacing_for_positions(['1B', '2B', '3B', 'OF', 'SS', 'C'], 3) ----> 6 optimizer.add_stack(TeamStack(3)) 7 optimizer.add_stack(TeamStack(3, for_teams=['SD', 'NYY', 'CHC'])) 8 for lineup in optimizer.optimize(n=100, randomness=True, max_exposure=.99, exposure_strategy=AfterEachExposureStrategy): **NameError: name 'TeamStack' is not defined** Thank you all for your time
Denwen12 commented 4 years ago

Dont forget to import the functions

from pydfs_lineup_optimizer.stacks import TeamStack, PositionsStack, PlayersGroup
from pydfs_lineup_optimizer import AfterEachExposureStrategy
sansbacon commented 4 years ago

This issue can be closed

Milkman9691 commented 2 years ago

Anyone wanna tell a noob why this is kickin a "ValueError: max() arg is an empty sequence" now?