@@ -22,9 +22,10 @@ def __init__(
22
22
param_to_axis_label : dict [str , str ] | None = None ,
23
23
plot_font : Literal ["Dejavu Sans" , "Times New Roman" ] = "Dejavu Sans" ,
24
24
plot_grid : bool = False ,
25
+ output_folder_name : str = "output" ,
25
26
):
26
27
self .folder_path = plib .Path (folder_path )
27
- self .out_path = plib .Path (folder_path , "output" )
28
+ self .out_path = plib .Path (self . folder_path , output_folder_name )
28
29
if projectname is None :
29
30
self .projectname = self .folder_path .parts [- 1 ]
30
31
else :
@@ -747,6 +748,11 @@ def load_single_file(self, filename: str) -> pd.DataFrame:
747
748
skiprows = self .file_load_skiprows ,
748
749
)
749
750
file .rename (self .columns_to_rename_in_files , inplace = True , axis = "columns" )
751
+ # check if all values in columns_to_rename_in_files are in the columns
752
+ # if not, raise an exception that prints the name of the filename
753
+ if not all ([col in file .columns for col in self .columns_to_rename_in_files .values ()]):
754
+ raise ValueError (f"columns_to_rename_in_files not in { filename = } " )
755
+
750
756
file = file .loc [file ["comp_name" ].notna (), self .columns_to_keep_in_files ]
751
757
file .set_index ("comp_name" , inplace = True )
752
758
file .rename (self .compounds_to_rename_in_files , inplace = True )
0 commit comments