James McCool
commited on
Commit
·
076e322
1
Parent(s):
251627a
Implement error handling in 'exposure_spread' to ensure comparable player list is generated safely, defaulting to an empty list if an exception occurs, enhancing robustness in player selection logic.
Browse files
global_func/exposure_spread.py
CHANGED
|
@@ -240,11 +240,12 @@ def exposure_spread(working_frame, exposure_player, exposure_target, ignore_stac
|
|
| 240 |
print(existing_players)
|
| 241 |
print(comparable_players)
|
| 242 |
print("^^^^ comparable players")
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
|
| 246 |
-
|
| 247 |
-
|
|
|
|
| 248 |
if comparable_player_list:
|
| 249 |
insert_player = random.choice(comparable_player_list)
|
| 250 |
# Find which column contains the exposure_player
|
|
|
|
| 240 |
print(existing_players)
|
| 241 |
print(comparable_players)
|
| 242 |
print("^^^^ comparable players")
|
| 243 |
+
try:
|
| 244 |
+
comparable_players = comparable_players[~comparable_players['player_names'].isin(existing_players)]
|
| 245 |
+
comparable_player_list = comparable_players['player_names'].tolist()
|
| 246 |
+
except:
|
| 247 |
+
comparable_player_list = []
|
| 248 |
+
|
| 249 |
if comparable_player_list:
|
| 250 |
insert_player = random.choice(comparable_player_list)
|
| 251 |
# Find which column contains the exposure_player
|