def line5(): ''' Player B5 (second pick).''' con = pi.open_sql_con() # Update the lineup by inserting the selected player on the previous page into the lineup table an.add_prev_player(con, form='fifth_pick', team='team_a', prev_pos=8, poss=[9]) # Retrieve the current lineup, available team B players, and the updated visualization (lineup, team_B_df, plot_url) = an.b_pick(con) con.close() return render_template('line5.html', teamb=team_B_df, lineup=lineup, plot_url=plot_url)
def pick5(): ''' Player A5 (first pick).''' con = pi.open_sql_con() # Update the lineup by insterting the selected player on the previous page into the lineup table an.add_prev_player(con, form='fourth_pick', team='team_a', prev_pos=6, poss=[8, 9]) # Retrieve the current lineup, available team A players, the recommended player selection, and the updated visualization (lineup, team_A_df, rec, plot_url) = an.a_pick_first(con) con.close() return render_template('pick5.html', teams5=team_A_df, rec=rec, lineup=lineup, plot_url=plot_url)
def summary(): ''' Produce summary statistics for this permutation to see how well it compares to random selections.''' con = pi.open_sql_con() # Update the lineup by insterting the selected player on the previous page into the lineup table an.add_prev_player(con, form='fifth_pick', team='team_b', prev_pos=9, poss=[]) # Retrieve the final lineup and summary statistics (final, tot_perms, perm_coef, av_coef, rank, plot_url) = an.create_summary(con) con.close() return render_template('summary.html', final=final, tot_perms=tot_perms, perm_coef=perm_coef, av_coef=av_coef, rank=rank, plot_url=plot_url)
def pick4(): ''' Player A4 (second pick).''' con = pi.open_sql_con() # Update the lineup by insterting the selected player on the previous page into the lineup table (player_4b, player_4b_id) = an.add_prev_player(con, form='fourth_pick', team='team_b', prev_pos=7, poss=[6, 8, 9]) # Retrieve the current lineup, available team A players, the recommended player selection, and the updated visualization (lineup, team_A_df, rec, plot_url) = an.a_pick_second(con, player_4b, player_4b_id) con.close() return render_template('pick4.html', options=team_A_df, rec=rec, lineup=lineup, plot_url=plot_url)