聚烯烃图片月度报告预测日期调整为月初

This commit is contained in:
workpc 2025-08-18 16:23:06 +08:00
parent ae2dba7981
commit 38953fb51a
3 changed files with 45 additions and 38 deletions

View File

@ -313,7 +313,6 @@ push_png_report_data = {
}
# 八大维度数据项编码
bdwd_items = {
'ciri': '251889263|FORECAST|PRICE|T01',
@ -442,7 +441,6 @@ table_name = 'v_tbl_crude_oil_warning'
# }
# # 八大维度数据项编码
# bdwd_items = {
# 'ciri': 'jxtppbdwdcr',
@ -460,12 +458,12 @@ table_name = 'v_tbl_crude_oil_warning'
# 'jxtppbdwdcsany': '次三月', 'jxtppbdwdcy': '次月', 'jxtppbdwdcz': '次周', 'jxtppbdwdgz': '隔周', }
# 北京环境数据库
# host = '192.168.101.27'
# port = 3306
# dbusername = 'root'
# password = '123456'
# dbname = 'jingbo_test'
# table_name = 'v_tbl_crude_oil_warning'
host = '192.168.101.27'
port = 3306
dbusername = 'root'
password = '123456'
dbname = 'jingbo_test'
table_name = 'v_tbl_crude_oil_warning'
DEFAULT_CONFIG = {
'feature_factor_frequency': 'D',

View File

@ -116,9 +116,10 @@ if __name__ == '__main__':
# 图片报告
try:
logger.info('图片报告ing')
global_config['end_time'] = '2025-08-14'
pp_bdwd_png(global_config=global_config)
logger.info('图片报告end')
except Exception as e:
logger.info(f'图片报告失败:{e}')
time.sleep(5)
push_png_report()
# time.sleep(5)
# push_png_report()

View File

@ -1114,6 +1114,14 @@ def plot_pp_predict_result(y_hat, global_config, wd='yuedu'):
if wd == 'yuedu':
y = pd.read_csv(os.path.join(
global_config['dataset'], '指标数据.csv'))[['ds', 'y']][-12:]
# 修改ds列的日为1日
print(y_hat)
y_hat['ds'] = pd.to_datetime(y_hat['ds'])
y_hat['ds'] = y_hat['ds'].dt.strftime('%Y-%m-01')
# ds 转换为日期类型
y_hat['ds'] = pd.to_datetime(y_hat['ds'])
print(y_hat)
xgx_df = pd.read_csv(os.path.join(
global_config['dataset'], '相关系数.csv'))
title = 'PP期货月维度预测价格走势'