James McCool commited on
Commit
3c6a773
·
1 Parent(s): bc69eff

Refactor player ID combination logic in grab_contest_data function

Browse files

- Commented out the previous player ID mapping logic to prevent potential issues while retaining it for reference.
- Updated the combination of player positions and IDs to directly concatenate them, simplifying the output formatting.
- These changes contribute to ongoing efforts to enhance data integrity and improve user experience within the application.

Files changed (1) hide show
  1. global_func/grab_contest_data.py +10 -7
global_func/grab_contest_data.py CHANGED
@@ -23,13 +23,16 @@ def grab_contest_data(sport, contest_name, contest_id_map, contest_date):
23
  print(f"Warning: Mismatch for hash {lineup_hash}. IDs: {len(player_ids)}, Positions: {len(actual_positions)}")
24
  return lineup_hash
25
 
26
- # Combine positions and player IDs, only for valid player IDs
27
- combined_parts = []
28
- for pos, pid in zip(actual_positions, player_ids):
29
- if pid == '-1': # Handle empty slots
30
- combined_parts.append(pos + '')
31
- else:
32
- combined_parts.append(pos + pid_map.get(pid, pid))
 
 
 
33
 
34
  # Join them into a single string
35
  return "".join(combined_parts)
 
23
  print(f"Warning: Mismatch for hash {lineup_hash}. IDs: {len(player_ids)}, Positions: {len(actual_positions)}")
24
  return lineup_hash
25
 
26
+ # # Combine positions and player IDs, only for valid player IDs
27
+ # combined_parts = []
28
+ # for pos, pid in zip(actual_positions, player_ids):
29
+ # if pid == '-1': # Handle empty slots
30
+ # combined_parts.append(pos + '')
31
+ # else:
32
+ # combined_parts.append(pos + pid_map.get(pid, pid))
33
+
34
+ # Just combine positions and PIDs without name mapping
35
+ combined_parts = [pos + pid for pos, pid in zip(actual_positions, player_ids)]
36
 
37
  # Join them into a single string
38
  return "".join(combined_parts)