예제 #1
0
def test_default_lineup():
    players = _generate_test_player_data()
    optimized = optimize(players)
    ntools.assert_equal(
        optimized.total,
        50 + 48 + 46 + 44 + 42 + 40
    )
예제 #2
0
def test_locked_teams():
    players = _generate_test_player_data()
    test_args = args_dict.copy()
    test_args['locked_teams'] = [_GS]
    optimized = optimize(players, cmd_args=Namespace(**test_args))
    ntools.assert_equal(
        optimized.total,
        49 + 47 + 45 + 43 + 41 + 39
    )
예제 #3
0
def test_locked_players():
    players = _generate_test_player_data()
    test_args = args_dict.copy()
    test_args['locked'] = ['B', 'D']
    optimized = optimize(players, cmd_args=Namespace(**test_args))
    ntools.assert_equal(
        optimized.total,
        49 + 47 + 46 + 44 + 42 + 40
    )
예제 #4
0
import scrapers
import dke_exceptions as dke
from pickem.pickem_command_line import get_args
from pickem.pickem_optimize import optimize, get_all_players

if __name__ == '__main__':
    args = get_args()
    if args.scrape_source:
        try:
            scrapers.scrape(args.scrape_source)
        except KeyError:
            raise dke.InvalidProjectionSourceException(
                'You must choose from the following data sources {}.'
                .format(scrapers.scrape_dict.keys())
            )

    all_players = get_all_players(
        args.salary_file,
        args.projection_file,
        args.use_averages,
    )
    print(optimize(all_players, args))
예제 #5
0
from pickem.pickem_command_line import get_args
from pickem.pickem_optimize import optimize, get_all_players

if __name__ == '__main__':
    args = get_args()
    all_players = get_all_players(
        args.salary_file,
        args.projection_file,
        args.use_averages,
    )
    print(optimize(all_players, args))