James McCool commited on
Commit
6c7f446
·
1 Parent(s): cac37db

Fix payout position calculation in app.py

Browse files

- Adjusted the logic in the get_payout_for_position function to correctly account for finish positions by changing the condition to check for finish_pos + 1 instead of finish_pos - 1.
- This change ensures accurate retrieval of payout information based on the updated position criteria, improving the reliability of payout calculations.

Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -106,8 +106,8 @@ def export_contest_file(db, sport, type, contest_date, contest_id, contest_data)
106
  def get_payout_for_position(finish_pos, payout_df):
107
  # Find the row where finish_pos falls between minPosition and maxPosition
108
  matching_row = payout_df[
109
- (payout_df['minPosition'] <= finish_pos - 1) &
110
- (payout_df['maxPosition'] >= finish_pos - 1)
111
  ]
112
  if not matching_row.empty:
113
  return matching_row.iloc[0]['value']
 
106
  def get_payout_for_position(finish_pos, payout_df):
107
  # Find the row where finish_pos falls between minPosition and maxPosition
108
  matching_row = payout_df[
109
+ (payout_df['minPosition'] <= finish_pos + 1) &
110
+ (payout_df['maxPosition'] >= finish_pos + 1)
111
  ]
112
  if not matching_row.empty:
113
  return matching_row.iloc[0]['value']