James McCool commited on
Commit
1a4a0d8
·
1 Parent(s): f13359a

Refactor player selection logic in 'exposure_spread' by removing redundant salary constraints for specific replacements, streamlining the lineup generation process.

Browse files
Files changed (1) hide show
  1. global_func/exposure_spread.py +2 -4
global_func/exposure_spread.py CHANGED
@@ -212,8 +212,7 @@ def exposure_spread(working_frame, exposure_player, exposure_target, ignore_stac
212
  for row in random_row_indices_insert:
213
  if change_counter < math.ceil(lineups_to_remove):
214
  if specific_replacements != []:
215
- comparable_players = projections_df[(projections_df['player_names'].isin(specific_replacements)) &
216
- (projections_df['salary'] <= comp_salary_high + (salary_max - working_frame['salary'][row]))
217
  ]
218
  else:
219
  comparable_players = projections_df[
@@ -263,8 +262,7 @@ def exposure_spread(working_frame, exposure_player, exposure_target, ignore_stac
263
  for row in random_row_indices_replace:
264
  if change_counter < math.ceil(lineups_to_add):
265
  if specific_replacements != []:
266
- comparable_players = projections_df[(projections_df['player_names'].isin(specific_replacements)) &
267
- (projections_df['salary'] <= comp_salary_high + (salary_max - working_frame['salary'][row]))
268
  ]
269
  else:
270
  comparable_players = projections_df[
 
212
  for row in random_row_indices_insert:
213
  if change_counter < math.ceil(lineups_to_remove):
214
  if specific_replacements != []:
215
+ comparable_players = projections_df[(projections_df['player_names'].isin(specific_replacements))
 
216
  ]
217
  else:
218
  comparable_players = projections_df[
 
262
  for row in random_row_indices_replace:
263
  if change_counter < math.ceil(lineups_to_add):
264
  if specific_replacements != []:
265
+ comparable_players = projections_df[(projections_df['player_names'].isin(specific_replacements))
 
266
  ]
267
  else:
268
  comparable_players = projections_df[