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

No Solution Found FD MVP Rule Set #203

Open
aggiefury101 opened this issue Oct 24, 2023 · 2 comments
Open

No Solution Found FD MVP Rule Set #203

aggiefury101 opened this issue Oct 24, 2023 · 2 comments

Comments

@aggiefury101
Copy link

aggiefury101 commented Oct 24, 2023

Good Morning. When I try to run draftfast with the FD MVP ruleset I get the No solution found try adjusting your constraints, but everything is left open. I attached the salaries csv. Please let me know where I missed the mark and thanks for your help!

from draftfast import rules
from draftfast.optimize import run
from draftfast.csv_parse import salary_download


# Generate the player pool from a CSV file:
player_pool = salary_download.generate_players_from_csvs(
    salary_file_location="C:/Users/romahngr/Downloads/salaries (2).csv",
    game=rules.FAN_DUEL,  # Ensure the game is set to FanDuel
)

roster = run(
    rule_set=rules.FD_NFL_MVP_RULE_SET,  # Use the FanDuel MVP rule set
    player_pool=player_pool,
    verbose=True,
   )

print(roster)

# If you later decide to upload to FanDuel (this part wasn't provided in your example, but just in case you need it):
# from draftfast.csv_parse import uploaders

# uploader = uploaders.FanDuelNFLUploader(
#     pid_file='./your_pid_file.csv',
# )
# uploader.write_rosters([roster])
@aggiefury101
Copy link
Author

salaries (2).csv

@BenBrostoff
Copy link
Owner

Hey @aggiefury101 - have you tried looking at this test

def test_fd_showdown_nfl():
players = salary_download.generate_players_from_csvs(
salary_file_location=fd_mvp_nfl_salaries,
projection_file_location=projections,
game=FAN_DUEL,
ruleset=FD_NFL_MVP_RULE_SET,
)
ntools.assert_equals(len(players), 146)
# Two same ID players should break out captain and flex
# and have identical costs
renfrow = [
p for p in players
if p.name == 'Hunter Renfrow'
]
ntools.assert_equals(len(renfrow), 2)
ntools.assert_equals(renfrow[0].cost, renfrow[1].cost)
ntools.assert_almost_equals(
renfrow[0].average_score,
renfrow[1].average_score * 1.5
)
ntools.assert_equals(renfrow[0].pos, 'CPT')
ntools.assert_equals(renfrow[1].pos, 'FLEX')
# Optimization should work
optimized = run(
rule_set=FD_NFL_MVP_RULE_SET,
player_pool=players
)
ntools.assert_equals(len(optimized.players), 5)
? This is still passing and it would be helpful to know how your example is different from the test.

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

2 participants