-
Notifications
You must be signed in to change notification settings - Fork 84
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
Bugfix 630/invalid team #631
Closed
Closed
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
8018f23
make compulsory transfers if we have an invalid team after transfer w…
nbarlowATI d893e70
update a few docstrings
nbarlowATI dbe6c23
slightly change logic for compulsory transfers
nbarlowATI 7213a95
disregard possibility where we have >2 compulsory transfers
nbarlowATI 470dfb7
pass dbsession argument to get_player
nbarlowATI File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we'd want the 2nd player out to also be limited to
candidate_players_to_remove
? E.g. if we have 4 City players the best way to solve it might be to make 2 transfers where only 1 of the players transferred out is a City player.It could get messy but I think we want the first
len(candidate_players_to_remove)
players out to be limited to players incandidate_players_to_remove
, and any subsequent players out to be any player insquad.players
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah there's some additional logic later on that I missed here, having another think...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep good point! I just simplified the logic in
make_best_transfers
and changed the logic inmake_optimum_double_transfer
now, so that:make_optimum_single_transfer
will loop over that list (as before).make_optimum_double_transfer
. If that number is 1, we only usecandidate_players_to_remove
for the outer loop, and still loop over the whole squad in the inner loop. If it is 2 or more, we usecandidate_players_to_remove
for both the inner and outer loops.candidate_players_to_remove
in both the inner and outer loops, but the combinatorics are so much smaller in that case that I think it won't slow us down (plus it's a super-rare situation!)