Browse Source

修改部分错误(土壤质地),抛出错误,总和,相关性散点图

Kejl 1 tháng trước cách đây
mục cha
commit
8d760421fa
1 tập tin đã thay đổi với 9 bổ sung9 xóa
  1. 9 9
      rongzhong.py

+ 9 - 9
rongzhong.py

@@ -349,7 +349,7 @@ def checkData(fileUrl):
                 resData = resData.reset_index(drop=True)
                 resData['审核结果'] = table_1_res['审核结果']
                 global table_1_data
-                table_1_data_res = resData[resData['土壤质地'] != resData['土壤类型(判断)']]
+                table_1_data_res = resData[resData['土壤质地'] != resData['土壤质地(判断)']]
                 table_1_data = resData
                 # 提取异常指标数据
                 global table_1_index
@@ -361,8 +361,8 @@ def checkData(fileUrl):
                     '原因': table_1_res['审核结果']
                 })
                 # 这里数据直接使用即可(土壤质地填报)todo
-                del resData['土壤类型(判断)']
-                resData.insert(loc=6, column='土壤类型(判断)', value=table_1_res['土壤类型(判断)'])
+                del resData['土壤质地(判断)']
+                resData.insert(loc=6, column='土壤质地(判断)', value=table_1_res['土壤质地(判断)'])
                 global resData_1_Style
                 resData_1_Style = resData.style.apply(highlight_condition,axis=1)
                 # 表2--------------------------表2 土壤容重与机械组成总体数据频度分析----------------------------------------
@@ -644,7 +644,7 @@ def checkData(fileUrl):
             print("Excel 文件为空。")
     except Exception as err:
         print('审核过程中出错!', err)
-        show_error('审核过程中出错!')
+        show_error(f'审核过程中出错!错误原因:{err}')
 
 
 def makeNormalWord(url):
@@ -797,8 +797,8 @@ def getReport(originData,data,changeFileUrl, saveFileUrl, check_1_data,
     del middData['原样品编号']
     check_1_data = pd.merge(check_1_data,middData, how='left', on='编号')
     check_1_data = check_1_data.replace(np.nan,'')
-    typeNotSame = check_1_data[check_1_data['土壤质地'] != check_1_data['土壤类型(判断)']]
-    table_6_data = typeNotSame[['编号','样品编号', '土壤质地', '土壤类型(判断)']]
+    typeNotSame = check_1_data[check_1_data['土壤质地'] != check_1_data['土壤质地(判断)']]
+    table_6_data = typeNotSame[['编号','样品编号', '土壤质地', '土壤质地(判断)']]
 
     allNeedData = pd.DataFrame({})
     allNeedData['原样品编号'] = check_1_data['编号']
@@ -1598,9 +1598,9 @@ def saveFile():
             imgData = nowTable_sw.dropna(subset=['有机质g/kg','总和(%)'])
             if not imgData['有机质g/kg'].empty and not imgData['总和(%)'].empty:
                 getImg(imgData['有机质g/kg'],imgData['总和(%)'],mkdir_path,
-                       '有机质与总和相关性分析图','水稳性大团聚体数据','有机质g/kg','总和(%)',imgData['编号'],
+                       '有机质与水稳总和相关性散点图','水稳性大团聚体数据','有机质g/kg','水稳总和(%)',imgData['编号'],
                        mkdir_path + '/水稳性大团聚体数据-' + nowTime + '.xlsx','N1')
-                getStatisticsImg(nowTable_sw['总和(%)'], '总和(%)', '总和(%)',
+                getStatisticsImg(nowTable_sw['总和(%)'], '水稳总和(%)', '水稳总和(%)',
                                  mkdir_path + '/水稳性大团聚体数据-' + nowTime + '.xlsx', mkdir_path, 'B19')
                 getStatisticsImg(nowTable_sw['>5mm%'], '>5mm%', '>5mm%',
                                  mkdir_path + '/水稳性大团聚体数据-' + nowTime + '.xlsx', mkdir_path, 'C19')
@@ -1633,7 +1633,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', '水溶性全盐量',