Spaces:
Running
Running
James McCool
commited on
Commit
·
4f47917
1
Parent(s):
f26df66
Enhance flex multiplier calculations for RB, WR, and TE in Streamlit app to account for Superflex format, ensuring accurate evaluations across varying team sizes. Adjust maximum index limits for each position to improve player assessment accuracy.
Browse files- src/streamlit_app.py +6 -3
src/streamlit_app.py
CHANGED
@@ -282,11 +282,14 @@ def designate_custom_position_reqs(league_settings: dict, flex_percentiles: dict
|
|
282 |
|
283 |
if league_settings['TYPE'] == 'Superflex':
|
284 |
qb_rv_index = min(math.ceil((qb_base) * qb_flex_mult), 48)
|
|
|
|
|
|
|
285 |
else:
|
286 |
qb_rv_index = min(math.ceil((qb_base) * qb_flex_mult), 30)
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
|
291 |
print(f"Need {qb_rv_index} for QB in {league_settings['TEAMS']} teams with type {league_settings['TYPE']}")
|
292 |
print(f"Need {rb_rv_index} for RB in {league_settings['TEAMS']} teams with type {league_settings['TYPE']}")
|
|
|
282 |
|
283 |
if league_settings['TYPE'] == 'Superflex':
|
284 |
qb_rv_index = min(math.ceil((qb_base) * qb_flex_mult), 48)
|
285 |
+
rb_rv_index = min(math.ceil((rb_base + ((league_settings['TEAMS'] * league_settings['FLEX']) * flex_percentiles['RB'])) * rb_flex_mult), 48)
|
286 |
+
wr_rv_index = min(math.ceil((wr_base + ((league_settings['TEAMS'] * league_settings['FLEX']) * flex_percentiles['WR'])) * wr_flex_mult), 84)
|
287 |
+
te_rv_index = min(math.ceil((te_base + ((league_settings['TEAMS'] * league_settings['FLEX']) * flex_percentiles['TE'])) * te_flex_mult), 18)
|
288 |
else:
|
289 |
qb_rv_index = min(math.ceil((qb_base) * qb_flex_mult), 30)
|
290 |
+
rb_rv_index = min(math.ceil((rb_base + ((league_settings['TEAMS'] * league_settings['FLEX']) * flex_percentiles['RB'])) * rb_flex_mult), 60)
|
291 |
+
wr_rv_index = min(math.ceil((wr_base + ((league_settings['TEAMS'] * league_settings['FLEX']) * flex_percentiles['WR'])) * wr_flex_mult), 96)
|
292 |
+
te_rv_index = min(math.ceil((te_base + ((league_settings['TEAMS'] * league_settings['FLEX']) * flex_percentiles['TE'])) * te_flex_mult), 30)
|
293 |
|
294 |
print(f"Need {qb_rv_index} for QB in {league_settings['TEAMS']} teams with type {league_settings['TYPE']}")
|
295 |
print(f"Need {rb_rv_index} for RB in {league_settings['TEAMS']} teams with type {league_settings['TYPE']}")
|