nesticot commited on
Commit
52c06cb
·
verified ·
1 Parent(s): 1c52b3a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -130,22 +130,22 @@ def server(input, output, session):
130
  def spring_data():
131
 
132
  import polars as pl
133
- df_spring = pl.read_parquet(f"hf://datasets/TJStatsApps/mlb_data/data/mlb_pitch_data_2025_spring.parquet")
134
 
135
 
136
- # date = (datetime.datetime.now() - datetime.timedelta(hours=8)).date()
137
- # print(datetime.datetime.now())
138
- # date_str = date.strftime('%Y-%m-%d')
139
- # # Initialize the scraper
140
 
141
 
142
- # game_list_input = (scraper.get_schedule(year_input=[int(date_str[0:4])], sport_id=[1], game_type=['S'])
143
- # .filter(pl.col('date') == date)['game_id'])
144
 
145
- # data = scraper.get_data(game_list_input)
146
- # df = scraper.get_data_df(data)
147
 
148
- # df_spring = pl.concat([df_spring, df]).sort('game_date', descending=True)
149
 
150
  return df_spring.filter(pl.col('start_speed')>0)
151
 
 
130
  def spring_data():
131
 
132
  import polars as pl
133
+ df_spring = pl.read_parquet(f"hf://datasets/TJStatsApps/mlb_data/data/mlb_pitch_data_2025.parquet")
134
 
135
 
136
+ date = (datetime.datetime.now() - datetime.timedelta(hours=8)).date()
137
+ print(datetime.datetime.now())
138
+ date_str = date.strftime('%Y-%m-%d')
139
+ # Initialize the scraper
140
 
141
 
142
+ game_list_input = (scraper.get_schedule(year_input=[int(date_str[0:4])], sport_id=[1], game_type=['R'])
143
+ .filter(pl.col('date') == date)['game_id'])
144
 
145
+ data = scraper.get_data(game_list_input)
146
+ df = scraper.get_data_df(data)
147
 
148
+ df_spring = pl.concat([df_spring, df]).sort('game_date', descending=True)
149
 
150
  return df_spring.filter(pl.col('start_speed')>0)
151