Spaces:
Sleeping
Sleeping
Commit
·
220eee2
1
Parent(s):
174d220
enhance
Browse files
app.py
CHANGED
|
@@ -218,7 +218,7 @@ def calculate_min_max_bid_points(user_name):
|
|
| 218 |
total_points = get_user_total_points(user_name)
|
| 219 |
min_bid_points = math.ceil(total_points * 0.10) # round up
|
| 220 |
max_bid_points = math.floor(total_points * 0.50) # round down
|
| 221 |
-
return
|
| 222 |
|
| 223 |
|
| 224 |
def load_users(USERS_JSON):
|
|
@@ -244,6 +244,7 @@ def user_selection_and_prediction():
|
|
| 244 |
if user_name != "Select a user...":
|
| 245 |
min_bid_points, max_bid_points = calculate_min_max_bid_points(user_name)
|
| 246 |
st.write(f"Bid points range you can submit: {min_bid_points} to {max_bid_points}")
|
|
|
|
| 247 |
|
| 248 |
matches = get_today_matches()
|
| 249 |
if matches:
|
|
@@ -261,9 +262,9 @@ def user_selection_and_prediction():
|
|
| 261 |
|
| 262 |
bid_points = st.number_input(
|
| 263 |
"Bid Points",
|
| 264 |
-
min_value=min_bid_points,
|
| 265 |
-
max_value=max_bid_points,
|
| 266 |
-
value=min_bid_points,
|
| 267 |
format="%d"
|
| 268 |
)
|
| 269 |
|
|
|
|
| 218 |
total_points = get_user_total_points(user_name)
|
| 219 |
min_bid_points = math.ceil(total_points * 0.10) # round up
|
| 220 |
max_bid_points = math.floor(total_points * 0.50) # round down
|
| 221 |
+
return int(min_bid_points), int(max_bid_points)
|
| 222 |
|
| 223 |
|
| 224 |
def load_users(USERS_JSON):
|
|
|
|
| 244 |
if user_name != "Select a user...":
|
| 245 |
min_bid_points, max_bid_points = calculate_min_max_bid_points(user_name)
|
| 246 |
st.write(f"Bid points range you can submit: {min_bid_points} to {max_bid_points}")
|
| 247 |
+
st.write(f"min_bid_points: {min_bid_points} ({type(min_bid_points)}), max_bid_points: {max_bid_points} ({type(max_bid_points)})")
|
| 248 |
|
| 249 |
matches = get_today_matches()
|
| 250 |
if matches:
|
|
|
|
| 262 |
|
| 263 |
bid_points = st.number_input(
|
| 264 |
"Bid Points",
|
| 265 |
+
min_value=int(min_bid_points),
|
| 266 |
+
max_value=int(max_bid_points),
|
| 267 |
+
value=int(min_bid_points),
|
| 268 |
format="%d"
|
| 269 |
)
|
| 270 |
|