Closed revdarr closed 2 years ago
@revdarr Can look into this - do you have a CSV with projections you can send here so I can replicate? Additionally, it's worth mentioning here on CustomRule
the default comparison is here. You may need to override the default comparison such that solver_sum(g_a) == solver_sum(g_b)
. I can check this tomorrow and add a test with this exact condition (given player A is in the lineup, player B must be in the lineup and vice versa). This is definitely a very common use case so if there's a bug here I want to fix it ASAP.
Thanks! Here's my CSV. TestDK.csv
@revdarr This should be fixed by just changing the comparison function to solver_sum(g_a) == solver_sum(g_b)
. I updated tests to show this scenario in https://github.com/BenBrostoff/draftfast/commit/bf209c80727dbb334a2fd4c8e9ea7501aadbdce9 . If you use this rule, my testing shows:
Let me know if this fixes your issue and I can close this out if so.
Closing this issue as I think the test I added proves this works as expected.
The test seems to only allow for multiple players on b.
For example:
works but always has both Tatum and Brown
but
CustomRule( group_a=lambda p: p.name=='Gary Payton II', group_b=lambda p: p.name=='Jayson Tatum' )
Results in no solution found