Skip to content

Commit 66a4a72

Browse files
committed
hplc added modifiable output folder name
1 parent d98c0e5 commit 66a4a72

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/hplc_data_analysis/hplc.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,10 @@ def __init__(
2222
param_to_axis_label: dict[str, str] | None = None,
2323
plot_font: Literal["Dejavu Sans", "Times New Roman"] = "Dejavu Sans",
2424
plot_grid: bool = False,
25+
output_folder_name: str = "output",
2526
):
2627
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)
2829
if projectname is None:
2930
self.projectname = self.folder_path.parts[-1]
3031
else:
@@ -747,6 +748,11 @@ def load_single_file(self, filename: str) -> pd.DataFrame:
747748
skiprows=self.file_load_skiprows,
748749
)
749750
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+
750756
file = file.loc[file["comp_name"].notna(), self.columns_to_keep_in_files]
751757
file.set_index("comp_name", inplace=True)
752758
file.rename(self.compounds_to_rename_in_files, inplace=True)

0 commit comments

Comments
 (0)