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

AIrsenal fails if transfers already made in the gameweek #650

Open
jack89roberts opened this issue Oct 27, 2023 · 0 comments
Open

AIrsenal fails if transfers already made in the gameweek #650

jack89roberts opened this issue Oct 27, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@jack89roberts
Copy link
Contributor

AIrsenal gives a squad incomplete error at the end of the optimisation if transfers have previously been made that gameweek. The recommended transfers are printed but it fails when trying to decide the lineup, e.g. see below:

====================================

Strategy for Team ID: 1822891
Baseline score: 185.8936886660258
Best score: 191.54067033661735
 ===============================================
 ========= Optimum strategy ====================
 ===============================================

 =========== Gameweek 10 ================

Chips played:  None

Players in:			Players out:
-----------			------------
Lucas Digne			Ethan Pinnock

 =========== Gameweek 11 ================

Chips played:  None

Players in:			Players out:
-----------			------------
Phil Foden			Son Heung-min

 =========== Gameweek 12 ================

Chips played:  None

Players in:			Players out:
-----------			------------
Diogo Dalot Teixeira		Joel Matip

==========================
 Total score: 191

Getting starting squad for 1822891
Traceback (most recent call last):
  File "/Users/jroberts/micromamba/envs/airsenalenv/bin/airsenal_run_pipeline", line 8, in <module>
    sys.exit(run_pipeline())
             ^^^^^^^^^^^^^^
  File "/Users/jroberts/micromamba/envs/airsenalenv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jroberts/micromamba/envs/airsenalenv/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/jroberts/micromamba/envs/airsenalenv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jroberts/micromamba/envs/airsenalenv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jroberts/repos/AIrsenal/airsenal/scripts/airsenal_run_pipeline.py", line 197, in run_pipeline
    opt_ok = run_optimize_squad(
             ^^^^^^^^^^^^^^^^^^^
  File "/Users/jroberts/repos/AIrsenal/airsenal/scripts/airsenal_run_pipeline.py", line 320, in run_optimize_squad
    run_optimization(
  File "/Users/jroberts/repos/AIrsenal/airsenal/scripts/fill_transfersuggestion_table.py", line 606, in run_optimization
    best_squad = print_team_for_next_gw(
                 ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/jroberts/repos/AIrsenal/airsenal/scripts/fill_transfersuggestion_table.py", line 396, in print_team_for_next_gw
    t.get_expected_points(next_gw, tag)
  File "/Users/jroberts/repos/AIrsenal/airsenal/framework/squad.py", line 396, in get_expected_points
    self.optimize_lineup(gameweek, tag)
  File "/Users/jroberts/repos/AIrsenal/airsenal/framework/squad.py", line 383, in optimize_lineup
    raise RuntimeError("Squad is incomplete")
RuntimeError: Squad is incomplete

I think this may need quite a few changes to fix, e.g. we don't add current gameweek transfers to the database and we'd need to check the number of free transfers available is updated correctly etc.

I believe this could be the problem @ParallaX07 and @Sandipbgn are having in #522 but that may be a separate problem.

@jack89roberts jack89roberts added the bug Something isn't working label Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant