DimaKudosh / pydfs-lineup-optimizer

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

Group setting with max exposure and Certain games #345

Open Denwen12 opened 2 years ago

Denwen12 commented 2 years ago

I'm trying to make this work but can't seam to make this work with new version, any help appreciated @DimaKudosh

teams = ['MIL', 'SAC']
test = PlayersGroup(optimizer.player_pool(players=[player for player in optimizer.player_pool.get_players if player.team in teams]), max_exposure=0.2)
optimizer.add_stack(Stack([test]))

THIS OLD WAY STILL WORKS NORMAL WITH OUT THE ADDED MAX EXPOSURE ADDED THEN ERRORS IF I ADD IT IN

teams = ['MIL', 'SAC']
optimizer.add_players_group(PlayersGroup(players=[player for player in optimizer.players if player.team in teams], min_from_group=8), max_exposure=0.5,)

I would get this error optimizer.add_players_group(PlayersGroup(players=[player for player in optimizer.players if player.team in teams], min_from_group=8), max_exposure=0.5,) TypeError: add_players_group() got an unexpected keyword argument 'max_exposure'

Denwen12 commented 2 years ago

Can max exposure be added to group settings?