James McCool
commited on
Commit
·
2371c4f
1
Parent(s):
b9049ff
Update lineups_to_remove calculation in exposure_spread function to handle cases where exposure_target is zero, ensuring accurate lineup adjustments based on player exposure.
Browse files
global_func/exposure_spread.py
CHANGED
|
@@ -251,7 +251,10 @@ def exposure_spread(working_frame, exposure_player, exposure_target, exposure_st
|
|
| 251 |
player_exposure = player_mask.sum() / len(working_frame)
|
| 252 |
|
| 253 |
# find the number of lineups that need to be removed to reach the target exposure
|
| 254 |
-
|
|
|
|
|
|
|
|
|
|
| 255 |
|
| 256 |
# isolate the rows that contain the player
|
| 257 |
player_rows = working_frame[player_mask]
|
|
|
|
| 251 |
player_exposure = player_mask.sum() / len(working_frame)
|
| 252 |
|
| 253 |
# find the number of lineups that need to be removed to reach the target exposure
|
| 254 |
+
if exposure_target == 0:
|
| 255 |
+
lineups_to_remove = (player_exposure * len(working_frame))
|
| 256 |
+
else:
|
| 257 |
+
lineups_to_remove = ((player_exposure - exposure_target) * len(working_frame)) * 1.01
|
| 258 |
|
| 259 |
# isolate the rows that contain the player
|
| 260 |
player_rows = working_frame[player_mask]
|