James McCool
commited on
Commit
·
201ffbb
1
Parent(s):
206da8c
Update hedging_preset function to include 'sport' parameter in small_field_preset and large_field_preset calls for enhanced lineup management flexibility. This change aligns with recent updates to improve sport-specific logic in lineup strategies.
Browse files
global_func/hedging_preset.py
CHANGED
@@ -59,11 +59,11 @@ def hedging_preset(portfolio: pd.DataFrame, lineup_target: int, projections_file
|
|
59 |
removed_df = working_df[remove_mask]
|
60 |
locked_df = working_df[lock_mask]
|
61 |
|
62 |
-
removed_lineups = small_field_preset(removed_df, math.ceil(lineup_target / (list_size * init_counter)), excluded_cols)
|
63 |
print(len(removed_lineups))
|
64 |
# Check if locked_df is empty before calling large_field_preset
|
65 |
if not locked_df.empty:
|
66 |
-
locked_lineups = large_field_preset(locked_df, math.ceil(lineup_target / (list_size * init_counter)), excluded_cols)
|
67 |
print(len(locked_lineups))
|
68 |
concat_portfolio = pd.concat([concat_portfolio, removed_lineups, locked_lineups])
|
69 |
else:
|
@@ -77,10 +77,10 @@ def hedging_preset(portfolio: pd.DataFrame, lineup_target: int, projections_file
|
|
77 |
removed_df = working_df[working_df['Stack'] != team]
|
78 |
teams_df = working_df[working_df['Stack'] == team]
|
79 |
|
80 |
-
removed_lineups = small_field_preset(removed_df, math.ceil(lineup_target / (list_size * init_counter)), excluded_cols)
|
81 |
# Check if teams_df is empty before calling large_field_preset
|
82 |
if not teams_df.empty:
|
83 |
-
team_lineups = large_field_preset(teams_df, math.ceil(lineup_target / (list_size * init_counter)), excluded_cols)
|
84 |
concat_portfolio = pd.concat([concat_portfolio, removed_lineups, team_lineups])
|
85 |
else:
|
86 |
# If no lineups have this team stacked, just add the removed lineups
|
|
|
59 |
removed_df = working_df[remove_mask]
|
60 |
locked_df = working_df[lock_mask]
|
61 |
|
62 |
+
removed_lineups = small_field_preset(removed_df, math.ceil(lineup_target / (list_size * init_counter)), excluded_cols, sport)
|
63 |
print(len(removed_lineups))
|
64 |
# Check if locked_df is empty before calling large_field_preset
|
65 |
if not locked_df.empty:
|
66 |
+
locked_lineups = large_field_preset(locked_df, math.ceil(lineup_target / (list_size * init_counter)), excluded_cols, sport)
|
67 |
print(len(locked_lineups))
|
68 |
concat_portfolio = pd.concat([concat_portfolio, removed_lineups, locked_lineups])
|
69 |
else:
|
|
|
77 |
removed_df = working_df[working_df['Stack'] != team]
|
78 |
teams_df = working_df[working_df['Stack'] == team]
|
79 |
|
80 |
+
removed_lineups = small_field_preset(removed_df, math.ceil(lineup_target / (list_size * init_counter)), excluded_cols, sport)
|
81 |
# Check if teams_df is empty before calling large_field_preset
|
82 |
if not teams_df.empty:
|
83 |
+
team_lineups = large_field_preset(teams_df, math.ceil(lineup_target / (list_size * init_counter)), excluded_cols, sport)
|
84 |
concat_portfolio = pd.concat([concat_portfolio, removed_lineups, team_lineups])
|
85 |
else:
|
86 |
# If no lineups have this team stacked, just add the removed lineups
|