Browse Source

Fix `compton_combiner.py` bug

* Решена проблема с заполнением таблиц (не обновлялись из-за pd.concat неправильного
порядка)
* Добавил апдейты по измерениям HIGH2023
compton 1 year ago
parent
commit
7cf2670c56
1 changed files with 2 additions and 1 deletions
  1. 2 1
      compton_combiner.py

+ 2 - 1
compton_combiner.py

@@ -541,10 +541,11 @@ def final_table_to_clbrdb(df: pd.DataFrame, clbrdb: CalibrdbHandler, runs_df: pd
 def save_csv(df: pd.DataFrame, filepath: str, update_current: bool = True):
     """Saves csv file. Updates current file in filepath if exists"""
     
+    logging.info(f'Saving csv file: len(df)={len(df)}, filepath={filepath}, update_current={update_current}')
     if (os.path.isfile(filepath) and update_current):
         df_current = pd.read_csv(filepath)
         # df_current = df_current.append(df, ignore_index=True)
-        df_current = pd.concat([df, df_current], ignore_index=True)
+        df_current = pd.concat([df_current, df], ignore_index=True)
         df_current = df_current.drop_duplicates(subset=['energy_point', 'first_run'], keep='last')
         df = df_current