DimaKudosh / pydfs-lineup-optimizer

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

Invalid positions error when trying to add 'Min Exposure' and 'Max Exposure' columns to player pool CSV #385

Open DevChrisMiller opened 2 years ago

DevChrisMiller commented 2 years ago

When I run the optimizer using a default CSV I get no errors.

I see in the documentation: "You can add “Max Exposure” and “Min Exposure” columns with exposure percentage for some players to csv that will be parsed while players loading. "

So I've attempted to add exposure columns and use a CSV with this format:

Position,Name + ID,Name,ID,Roster Position,Salary,Game Info,TeamAbbrev,AvgPointsPerGame,Min Exposure,Max Exposure
PG,Luka Doncic (25007692),Luka Doncic,25007692,PG/G/UTIL,12000,DAL @ BKN 2022-10-27T23:30:00.0000000Z,DAL,60.23,0.2,0.4
PG,Ja Morant (25007695),Ja Morant,25007695,PG/G/UTIL,10200,MEM @ SAC 2022-10-28T02:00:00.0000000Z,MEM,55.67,0.15,0.25
SF/PF,Kevin Durant (25007698),Kevin Durant,25007698,SF/PF/F/UTIL,10000,DAL @ BKN 2022-10-27T23:30:00.0000000Z,BKN,48.26,0.05,0.2
PG,Stephen Curry (25007702),Stephen Curry,25007702,PG/G/UTIL,9900,MIA @ GSW 2022-10-28T02:00:00.0000000Z,GSW,52.67,0.05,0.14
PG/SF,Ben Simmons (25007747),Ben Simmons,25007747,PG/SF/G/F/UTIL,6400,DAL @ BKN 2022-10-27T23:30:00.0000000Z,BKN,28.96,0.05,0.2
...

This results in the invalid position constraints: pydfs_lineup_optimizer.exceptions.GenerateLineupException: Can't generate lineups. Following constraints are not valid: positions_PG,positions_PG_SG,positions_PG_SF,positions_PG_SF_SG

Am I adding the columns to the CSV incorrectly, or making some other error here? If not, is there a way around this issue? Like I said, I don't get any error with my positions definition before trying to add the 'Min Exposure' and 'Max Exposure' columns to the end of the CSV. Any help would be appreciated, thanks.

Denwen12 commented 2 years ago

Let's see your csv

On Thu, Oct 27, 2022, 7:45 PM Chris Miller @.***> wrote:

When I run the optimizer using a default CSV I get no errors.

I see in the documentation: "You can add “Max Exposure” and “Min Exposure” columns with exposure percentage for some players to csv that will be parsed while players loading. "

So I've attempted to add exposure columns and use a CSV with this format:

Position,Name + ID,Name,ID,Roster Position,Salary,Game Info,TeamAbbrev,AvgPointsPerGame,Min Exposure,Max Exposure

PG,Luka Doncic (25007692),Luka Doncic,25007692,PG/G/UTIL,12000,DAL @ BKN 2022-10-27T23:30:00.0000000Z,DAL,60.23,0.2,0.4

PG,Ja Morant (25007695),Ja Morant,25007695,PG/G/UTIL,10200,MEM @ SAC 2022-10-28T02:00:00.0000000Z,MEM,55.67,0.15,0.25

SF/PF,Kevin Durant (25007698),Kevin Durant,25007698,SF/PF/F/UTIL,10000,DAL @ BKN 2022-10-27T23:30:00.0000000Z,BKN,48.26,0.05,0.2

PG,Stephen Curry (25007702),Stephen Curry,25007702,PG/G/UTIL,9900,MIA @ GSW 2022-10-28T02:00:00.0000000Z,GSW,52.67,0.05,0.14

PG/SF,Ben Simmons (25007747),Ben Simmons,25007747,PG/SF/G/F/UTIL,6400,DAL @ BKN 2022-10-27T23:30:00.0000000Z,BKN,28.96,0.05,0.2

...

This results in the invalid position constraints: pydfs_lineup_optimizer.exceptions.GenerateLineupException: Can't generate lineups. Following constraints are not valid: positions_PG,positions_PG_SG,positions_PG_SF,positions_PG_SF_SG

Am I adding the columns to the CSV incorrectly, or making some other error here? If not, is there a way around this issue? Like I said, I don't get any error with my positions definition before trying to add the 'Min Exposure' and 'Max Exposure' columns to the end of the CSV. Any help would be appreciated, thanks.

— Reply to this email directly, view it on GitHub https://github.com/DimaKudosh/pydfs-lineup-optimizer/issues/385, or unsubscribe https://github.com/notifications/unsubscribe-auth/ANBWO7WHNLY47FRTPRQLFDTWFMHYXANCNFSM6AAAAAARQRXNNE . You are receiving this because you are subscribed to this thread.Message ID: @.***>

DimaKudosh commented 1 year ago

Probably you set exposures in a way that lineups can't be built