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

Restrict players from same team #435

Open
u1tra7 opened this issue Oct 29, 2024 · 2 comments
Open

Restrict players from same team #435

u1tra7 opened this issue Oct 29, 2024 · 2 comments

Comments

@u1tra7
Copy link

u1tra7 commented Oct 29, 2024

Any chance we can have a this rule added, where we can specify on optimizer the number of players from the same team, but any team without specifying a position.

the documents have:

Restrict players from same team

In some cases you would want to restrict creating of lineup with players from same team, for example prevent of 2 RB from same team. For this you can use restrict_positions_for_same_team method of optimizer, it takes tuples with 2 positions.

optimizer.restrict_positions_for_same_team(('RB', 'RB'))
optimizer.restrict_positions_for_same_team(('QB', 'DST'), ('RB', 'DST'))

but say in NBA, where we may just want to set a limit per team (not position based, it would be cool to be able to do:

optimizer.set_max_players_from_team(2)

@lightninglarry
Copy link

you can do this is another round about way, forgot the exact syntax I have
but essentially put minimum teams to 4 or 5(depending on site you are playing on), and it wont allow you to put more than 2 players from a given team.

@u1tra7
Copy link
Author

u1tra7 commented Oct 29, 2024

@lightninglarry, appreciate the input. I believe I saw your thread related to this. Will see if I could figure it out. Hoping we could get an enhancement, but its not detrimental. Appreciate it.

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