|
@@ -7,7 +7,9 @@ import logging
|
|
|
import traceback
|
|
|
from common.database_dml import get_data_from_mongo,insert_data_into_mongo
|
|
|
from common.alert import send_message
|
|
|
-from datetime import date, timedelta
|
|
|
+from datetime import datetime, timedelta
|
|
|
+import pytz
|
|
|
+from pytz import timezone
|
|
|
app = Flask('model_prediction_lightgbm——service')
|
|
|
def str_to_list(arg):
|
|
|
if arg == '':
|
|
@@ -18,7 +20,9 @@ def str_to_list(arg):
|
|
|
|
|
|
def forecast_data_distribution(pre_data,args):
|
|
|
col_time = args['col_time']
|
|
|
- tomorrow = (date.today() + timedelta(days=1)).strftime('%Y-%m-%d')
|
|
|
+
|
|
|
+ # tomorrow = (date.today() + timedelta(days=1)).strftime('%Y-%m-%d')
|
|
|
+ tomorrow = (datetime.now(pytz.utc).astimezone(timezone("Asia/Shanghai")) + timedelta(days=1)).strftime('%Y-%m-%d')
|
|
|
field_mapping = {'clearsky_ghi': 'clearskyGhi', 'dni_calcd': 'dniCalcd','surface_pressure':'surfacePressure'}
|
|
|
# 根据字段映射重命名列
|
|
|
pre_data = pre_data.rename(columns=field_mapping)
|