Hi there again, I am trying to use the restrict positions for opposing team constraint but I can't seem to load in the game variable correctly. I'm not exactly sure how to give each player the home_team attribute because it doesn't seem like you can add is a kwarg. Any insight on fixing this would be great. Cheers.
File "E:\DFS-Model\Simulations\untitled0.py", line 52, in
for lineup in o.optimize(n=1):
File "C:\Users\William\anaconda3\lib\site-packages\pydfs_lineup_optimizer\lineup_optimizer.py", line 387, in optimize
constraint.apply(base_solver)
File "C:\Users\William\anaconda3\lib\site-packages\pydfs_lineup_optimizer\rules.py", line 398, in apply
home_team_players = {player: variable for player, variable in self.players_dict.items()
File "C:\Users\William\anaconda3\lib\site-packages\pydfs_lineup_optimizer\rules.py", line 399, in
if player.team == game.home_team}
AttributeError: 'str' object has no attribute 'home_team'
Hi there again, I am trying to use the restrict positions for opposing team constraint but I can't seem to load in the game variable correctly. I'm not exactly sure how to give each player the home_team attribute because it doesn't seem like you can add is a kwarg. Any insight on fixing this would be great. Cheers.
CSV: FD.csv
Code:
AttributeError: runfile('E:/DFS-Model/Simulations/untitled0.py', wdir='E:/DFS-Model/Simulations') Traceback (most recent call last):
File "E:\DFS-Model\Simulations\untitled0.py", line 52, in
for lineup in o.optimize(n=1):
File "C:\Users\William\anaconda3\lib\site-packages\pydfs_lineup_optimizer\lineup_optimizer.py", line 387, in optimize constraint.apply(base_solver)
File "C:\Users\William\anaconda3\lib\site-packages\pydfs_lineup_optimizer\rules.py", line 398, in apply home_team_players = {player: variable for player, variable in self.players_dict.items()
File "C:\Users\William\anaconda3\lib\site-packages\pydfs_lineup_optimizer\rules.py", line 399, in
if player.team == game.home_team}
AttributeError: 'str' object has no attribute 'home_team'