Prechádzať zdrojové kódy

修改:文件名异常

张世豪 1 mesiac pred
rodič
commit
bcfd9ef64a
3 zmenil súbory, kde vykonal 12 pridanie a 12 odobranie
  1. 7 7
      index.py
  2. 3 3
      partReport.py
  3. 2 2
      report.py

+ 7 - 7
index.py

@@ -186,7 +186,7 @@ def getImg(x,y,url,name,sheetName,xLabel,YLabel,numArr,fileUrl,loc):
     y_pred = model.predict(x.to_numpy().reshape(-1, 1))
     fig.add_trace(go.Scatter(x=x, y=y_pred, mode='lines', name='拟合直线'))
 
-    html_file_path = f"{url}/{name}频度统计图.html"
+    html_file_path = f"{url}/{name}.html"
     pio.write_html(fig, file=html_file_path, auto_open=False)
     # 在表格中插入html
     workbook = load_workbook(filename=fileUrl)
@@ -1226,10 +1226,10 @@ def getReport(originData,data,changeFileUrl, saveFileUrl, check_1_data,
     paragraph_t_12.add_run(f'图12:全盐量分布图').bold = True
     paragraph_t_12.alignment = WD_ALIGN_PARAGRAPH.CENTER
 
-    if os.path.isfile(f'{mkdir_path}/全盐量与电导率相关性分析图.png'):
-        doc.add_picture(f'{mkdir_path}/全盐量与电导率相关性分析图.png', width=Inches(6.0))
+    if os.path.isfile(f'{mkdir_path}/全盐量与电导率相关性散点图.png'):
+        doc.add_picture(f'{mkdir_path}/全盐量与电导率相关性散点图.png', width=Inches(6.0))
     paragraph_t_13 = doc.add_paragraph()
-    paragraph_t_13.add_run(f'图13:全盐量与电导率相关性分析图').bold = True
+    paragraph_t_13.add_run(f'图13:全盐量与电导率相关性散点图').bold = True
     paragraph_t_13.alignment = WD_ALIGN_PARAGRAPH.CENTER
 
     if os.path.isfile(f'{mkdir_path}/离子总量与水溶性盐总量关系图.png'):
@@ -1866,7 +1866,7 @@ def saveFile():
             nowTable_sr = pd.read_excel(mkdir_path + '/土壤水溶性盐数据-' + nowTime + '.xlsx',
                                         sheet_name='水溶性盐数据')
             imgData_sr = nowTable_sr.dropna(subset=['水溶性全盐量g/kg', '电导率ms/cm'])
-            getImg(imgData_sr['水溶性全盐量g/kg'],imgData_sr['电导率ms/cm'],mkdir_path,'全盐量与电导率相关性分析图',
+            getImg(imgData_sr['水溶性全盐量g/kg'],imgData_sr['电导率ms/cm'],mkdir_path,'全盐量与电导率相关性散点图',
                   '水溶性盐数据', '水溶性全盐量g/kg','电导率ms/cm',
                    imgData_sr['样品编号'],mkdir_path + '/土壤水溶性盐数据-' + nowTime + '.xlsx','T1')
             getStatisticsImg(nowTable_sr['水溶性全盐量g/kg'], '水溶性全盐量g/kg', '水溶性全盐量',
@@ -1885,11 +1885,11 @@ def saveFile():
             imgData_NPK = nowTable_NPK.dropna(subset=['有机质g/kg', '全氮g/kg'])
             cationImgData = nowTable_NPK.dropna(subset=['有机质g/kg', '阳离子交换量'])
             if not imgData_NPK.empty:
-                getImg(imgData_NPK['有机质g/kg'],imgData_NPK['全氮g/kg'],mkdir_path,'有机质和全氮相关性分析图','土壤氮磷钾数据',
+                getImg(imgData_NPK['有机质g/kg'],imgData_NPK['全氮g/kg'],mkdir_path,'有机质和全氮相关性散点图','土壤氮磷钾数据',
                    '有机质g/kg','全氮g/kg',imgData_NPK['编号'],mkdir_path + '/土壤氮磷钾数据-' + nowTime + '.xlsx','P1')
             if not cationImgData.empty:
                 getImg(cationImgData['有机质g/kg'], cationImgData['阳离子交换量'], mkdir_path,
-                   '有机质和阳离子交换量相关性分析图',
+                   '有机质和阳离子交换量相关性散点图',
                    '土壤氮磷钾数据',
                    '有机质g/kg', '阳离子交换量', cationImgData['编号'],
                    mkdir_path + '/土壤氮磷钾数据-' + nowTime + '.xlsx',

+ 3 - 3
partReport.py

@@ -1815,10 +1815,10 @@ def getChemicalIndicators(originData, data,type, changeFileUrl, saveFileUrl, che
     paragraph_t_11.add_run(f'图11:全盐量分布图').bold = True
     paragraph_t_11.alignment = WD_ALIGN_PARAGRAPH.CENTER
 
-    if os.path.isfile(f'{mkdir_path}/全盐量与电导率相关性分析图.png'):
-        doc.add_picture(f'{mkdir_path}/全盐量与电导率相关性分析图.png', width=Inches(6.0))
+    if os.path.isfile(f'{mkdir_path}/全盐量与电导率相关性散点图.png'):
+        doc.add_picture(f'{mkdir_path}/全盐量与电导率相关性散点图.png', width=Inches(6.0))
     paragraph_t_12 = doc.add_paragraph()
-    paragraph_t_12.add_run(f'图12:全盐量与电导率相关性分析图').bold = True
+    paragraph_t_12.add_run(f'图12:全盐量与电导率相关性散点图').bold = True
     paragraph_t_12.alignment = WD_ALIGN_PARAGRAPH.CENTER
 
     if os.path.isfile(f'{mkdir_path}/离子总量与全盐量关系图.png'):

+ 2 - 2
report.py

@@ -1019,10 +1019,10 @@ def manyTypes(data,url):
                       },
                       xaxis_title='全盐量(g/kg)',
                       yaxis_title='电导率(mS/cm)')
-    html_file_path = f"{url}/全盐量与电导率相关性分析图.html"
+    html_file_path = f"{url}/全盐量与电导率相关性散点图.html"
     pio.write_html(fig, file=html_file_path, auto_open=False)
     # 同时保存一份图片
-    pio.write_image(fig, f"{url}/全盐量与电导率相关性分析图.png")
+    pio.write_image(fig, f"{url}/全盐量与电导率相关性散点图.png")
     # 离子总量 全盐量及差值
     filterData = data.dropna(subset=['全盐量', '离子总量'])
     x2 = np.arange(0, len(filterData['离子总量']), 1)