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

Refine player selection in 'exposure_spread' by incorporating salary constraints for specific replacements, enhancing the precision of lineup generation.

Browse files
Files changed (1) hide show
  1. global_func/exposure_spread.py +3 -1
global_func/exposure_spread.py CHANGED
@@ -263,7 +263,9 @@ 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
  else:
268
  comparable_players = projections_df[
269
  (projections_df['salary'] >= comp_salary_low) &
 
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[
271
  (projections_df['salary'] >= comp_salary_low) &