Herc commited on
Commit
fbe06b5
·
1 Parent(s): 2ef814a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -1
app.py CHANGED
@@ -54,7 +54,12 @@ def assign_dates_to_matches(matches):
54
  end_date = date(2023, 3, 1)
55
  available_dates = [start_date + timedelta(days=i) for i in range((end_date - start_date).days) if (start_date + timedelta(days=i)).weekday() in [0, 2, 3, 5]]
56
  random.shuffle(available_dates)
57
- return [(match[0], match[1], available_dates[i]) for i, match in enumerate(matches)]
 
 
 
 
 
58
 
59
  # 6. generate_mock_historical_data
60
  def generate_mock_historical_data(num_teams, num_conferences, num_inter_games, start_date, end_date):
 
54
  end_date = date(2023, 3, 1)
55
  available_dates = [start_date + timedelta(days=i) for i in range((end_date - start_date).days) if (start_date + timedelta(days=i)).weekday() in [0, 2, 3, 5]]
56
  random.shuffle(available_dates)
57
+
58
+ # Ensure cyclic reuse of dates
59
+ extended_dates = available_dates * (len(matches) // len(available_dates) + 1)
60
+
61
+ return [(match[0], match[1], extended_dates[i]) for i, match in enumerate(matches)]
62
+
63
 
64
  # 6. generate_mock_historical_data
65
  def generate_mock_historical_data(num_teams, num_conferences, num_inter_games, start_date, end_date):