Rowan Martnishn commited on
Commit
1b05bbd
·
verified ·
1 Parent(s): 024996b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -174,7 +174,7 @@ def process_data():
174
  ax.plot(xnew, pred_smooth, color='#244B48', lw=3, label='Forecast')
175
  ax.scatter(np.arange(7), pred, color='#244B48', s=100, zorder=5)
176
 
177
- ax.set_title("7-Day Political Sentiment Forecast", fontsize=22, fontweight='bold', pad=20, fontproperties=custom_font)
178
  ax.set_xlabel("Day", fontsize=16, fontproperties=custom_font)
179
  ax.set_ylabel("Negative Sentiment (0-1)", fontsize=16, fontproperties=custom_font)
180
  ax.set_xticks(np.arange(7))
@@ -245,13 +245,13 @@ def run_daily():
245
  process_data()
246
  print("Data refreshed at:", datetime.datetime.now())
247
 
248
- schedule.every().day.at("00:00").do(run_daily)
249
- #schedule.every(10).seconds.do(run_daily)
250
 
251
  def run_schedule():
252
  while True:
253
  schedule.run_pending()
254
- time.sleep(60)
255
 
256
  import threading
257
  thread = threading.Thread(target=run_schedule)
 
174
  ax.plot(xnew, pred_smooth, color='#244B48', lw=3, label='Forecast')
175
  ax.scatter(np.arange(7), pred, color='#244B48', s=100, zorder=5)
176
 
177
+ ax.set_title(f"7-Day Political Sentiment Forecast - {datetime.datetime.now()}", fontsize=22, fontweight='bold', pad=20, fontproperties=custom_font)
178
  ax.set_xlabel("Day", fontsize=16, fontproperties=custom_font)
179
  ax.set_ylabel("Negative Sentiment (0-1)", fontsize=16, fontproperties=custom_font)
180
  ax.set_xticks(np.arange(7))
 
245
  process_data()
246
  print("Data refreshed at:", datetime.datetime.now())
247
 
248
+ #schedule.every().day.at("00:00").do(run_daily)
249
+ schedule.every(10).seconds.do(run_daily)
250
 
251
  def run_schedule():
252
  while True:
253
  schedule.run_pending()
254
+ #time.sleep(60)
255
 
256
  import threading
257
  thread = threading.Thread(target=run_schedule)