James McCool commited on
Commit
b98f268
·
1 Parent(s): face081

Adjust flex multiplier calculations for QB and TE in Streamlit app to account for team size, ensuring accurate evaluations across different league formats. Update base position requirements to reflect consistent scaling for all positions.

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +6 -6
src/streamlit_app.py CHANGED
@@ -275,10 +275,10 @@ def designate_custom_position_reqs(league_settings: dict, flex_percentiles: dict
275
  wr_base = league_settings['WR'] * league_settings['TEAMS']
276
  te_base = league_settings['TE'] * league_settings['TEAMS']
277
 
278
- qb_flex_mult = flex_multipliers['QB']
279
  rb_flex_mult = flex_multipliers['RB']
280
  wr_flex_mult = flex_multipliers['WR']
281
- te_flex_mult = flex_multipliers['TE']
282
 
283
  qb_rv_index = min(math.ceil((qb_base) * qb_flex_mult), 30)
284
  rb_rv_index = min(math.ceil((rb_base + ((league_settings['TEAMS'] * league_settings['FLEX']) * flex_percentiles['RB'])) * rb_flex_mult), 60)
@@ -305,10 +305,10 @@ def designate_base_position_reqs() -> dict:
305
  wr_base = 3 * 12
306
  te_base = 1 * 12
307
 
308
- qb_rv_index = min(math.ceil(qb_base * 2), 30)
309
- rb_rv_index = min(math.ceil((rb_base + ((12 * 1) * .40)) * 2), 60)
310
- wr_rv_index = min(math.ceil((wr_base + ((12 * 1) * .55)) * 2), 96)
311
- te_rv_index = min(math.ceil((te_base + ((12 * 1) * .05)) * 2), 30)
312
 
313
  print(f"Need {qb_rv_index} for QB in {12} teams with type {league_settings['TYPE']}")
314
  print(f"Need {rb_rv_index} for RB in {12} teams with type {league_settings['TYPE']}")
 
275
  wr_base = league_settings['WR'] * league_settings['TEAMS']
276
  te_base = league_settings['TE'] * league_settings['TEAMS']
277
 
278
+ qb_flex_mult = flex_multipliers['QB'] * (league_settings['TEAMS'] / 12)
279
  rb_flex_mult = flex_multipliers['RB']
280
  wr_flex_mult = flex_multipliers['WR']
281
+ te_flex_mult = flex_multipliers['TE'] * (league_settings['TEAMS'] / 12)
282
 
283
  qb_rv_index = min(math.ceil((qb_base) * qb_flex_mult), 30)
284
  rb_rv_index = min(math.ceil((rb_base + ((league_settings['TEAMS'] * league_settings['FLEX']) * flex_percentiles['RB'])) * rb_flex_mult), 60)
 
305
  wr_base = 3 * 12
306
  te_base = 1 * 12
307
 
308
+ qb_rv_index = min(math.ceil(qb_base * 1), 30)
309
+ rb_rv_index = min(math.ceil((rb_base + ((12 * 1) * .40)) * 1), 60)
310
+ wr_rv_index = min(math.ceil((wr_base + ((12 * 1) * .55)) * 1), 96)
311
+ te_rv_index = min(math.ceil((te_base + ((12 * 1) * .05)) * 1), 30)
312
 
313
  print(f"Need {qb_rv_index} for QB in {12} teams with type {league_settings['TYPE']}")
314
  print(f"Need {rb_rv_index} for RB in {12} teams with type {league_settings['TYPE']}")