Browse Source

修改主函数中删除重复项操作;修改vol_sor_est函数中取出部分数据列操作。

shangguanlie23 3 years ago
parent
commit
f2fb0acb3f

+ 7 - 7
LIB/MIDDLE/SaftyCenter/Liplated/main.py

@@ -53,25 +53,25 @@ def cell_platd_sorvol_test():
             [df_diag_sor_add, df_diag_vol_add, df_diag_sorvol_add] = Diag_sorvol_temp.volsor_cal()           
         if not df_Diag_lipltd_add.empty:
             df_Diag_lipltd_temp = df_Diag_lipltd.append(df_Diag_lipltd_add)
-            df_Diag_lipltd = df_Diag_lipltd_temp.drop_duplicates(subset = ['sn','time'], keep = 'first', inplace = True)
+            df_Diag_lipltd = df_Diag_lipltd_temp.drop_duplicates(subset = ['sn','time'], keep = 'first', inplace = False)
             df_Diag_lipltd.reset_index(drop = True)
             df_Diag_lipltd.sort_values(by = ['sn'], axis = 0, ascending=True,inplace=True)#对故障信息按照时间进行排序
             df_Diag_lipltd.to_csv(r'D:\Work\Code_write\data_analyze_platform\USER\lzx\01算法开发\02析锂检测\01下载数据\格林美-力信7255\SNnums_6040_liplated_sn.csv',index=False,encoding='GB18030')
         if not df_diag_sor_add.empty:
-            df_diag_sor = df_diag_sor.append(df_diag_sor_add)
-            df_diag_sor = df_diag_sor.drop_duplicates(subset = ['sn','time'], keep = 'first', inplace = False)
+            df_diag_sor_temp = df_diag_sor.append(df_diag_sor_add)
+            df_diag_sor = df_diag_sor_temp.drop_duplicates(subset = ['sn','time'], keep = 'first', inplace = False)
             df_diag_sor.reset_index(drop = True)
             df_diag_sor.sort_values(by = ['sn'], axis = 0, ascending=True,inplace=True)#对故障信息按照时间进行排序
             df_diag_sor.to_csv(r'D:\Work\Code_write\data_analyze_platform\USER\lzx\01算法开发\05内阻及电压估计\02算法检测\判断结果\内阻偏离.csv',index=False,encoding='GB18030')
         if not df_diag_vol_add.empty:
-            df_diag_vol = df_diag_vol.append(df_diag_vol_add)
-            df_diag_vol = df_diag_vol.drop_duplicates(subset = ['sn','time'], keep = 'first', inplace = False)
+            df_diag_vol_temp = df_diag_vol.append(df_diag_vol_add)
+            df_diag_vol = df_diag_vol_temp.drop_duplicates(subset = ['sn','time'], keep = 'first', inplace = False)
             df_diag_vol.reset_index(drop = True)
             df_diag_vol.sort_values(by = ['sn'], axis = 0, ascending=True,inplace=True)#对故障信息按照时间进行排序
             df_diag_vol.to_csv(r'D:\Work\Code_write\data_analyze_platform\USER\lzx\01算法开发\05内阻及电压估计\02算法检测\判断结果\电压偏离.csv',index=False,encoding='GB18030')
         if not df_diag_sorvol_add.empty:
-            df_diag_volsor = df_diag_volsor.append(df_diag_sorvol_add)
-            df_diag_volsor = df_diag_volsor.drop_duplicates(subset = ['sn','time'], keep = 'first', inplace = False)
+            df_diag_volsor_temp = df_diag_volsor.append(df_diag_sorvol_add)
+            df_diag_volsor = df_diag_volsor_temp.drop_duplicates(subset = ['sn','time'], keep = 'first', inplace = False)
             df_diag_volsor.reset_index(drop = True)
             df_diag_volsor.sort_values(by = ['sn'], axis = 0, ascending=True,inplace=True)#对故障信息按照时间进行排序
             df_diag_volsor.to_csv(r'D:\Work\Code_write\data_analyze_platform\USER\lzx\01算法开发\05内阻及电压估计\02算法检测\判断结果\电压内阻偏离.csv',index=False,encoding='GB18030')

+ 1 - 1
LIB/MIDDLE/SaftyCenter/Liplated/vol_sor_est.py

@@ -55,7 +55,7 @@ class vol_sor_est:
                 Tau = dt/2*(1 + theta[0,1]) / (1 - theta[0,1])
                 return [OCV,R0,R1,Tau]
             cellvolt_name = self.cellvolt_list
-            dischrgr_check_data = dischrg_data_temp.drop(['GSM信号','故障等级','故障代码','开关状态','单体压差','绝缘电阻','总电压[V]','充电状态','单体压差'],axis=1,inplace=False)
+            dischrgr_check_data = dischrg_data_temp.drop(['GSM信号','故障等级','故障代码','绝缘电阻','总电压[V]'],axis=1,inplace=False)
             dischrgr_check_data.fillna(value=0)
             df_est_vol_ful = pd.DataFrame()
             df_est_sor_ful = pd.DataFrame()