Skip to content
Snippets Groups Projects
Commit bdb75b2b authored by Rahil Doshi's avatar Rahil Doshi
Browse files

Improve error handling and parsing logic

parent 72358940
No related branches found
No related tags found
No related merge requests found
Pipeline #76411 passed
......@@ -357,7 +357,7 @@ def read_data_from_file(file_config: Union[str, Dict], header: bool = True) -> T
temp = df[temp_col].to_numpy(dtype=np.float64)
else:
raise ValueError(f"Temperature column '{temp_col}' not found in file. "
f"Available columns: {', '.join(df.columns)}")
f"\n -> Available columns: {', '.join(df.columns)}")
else:
if temp_col >= len(df.columns):
raise ValueError(f"Temperature column index {temp_col} out of bounds (file has {len(df.columns)} columns)")
......@@ -368,7 +368,7 @@ def read_data_from_file(file_config: Union[str, Dict], header: bool = True) -> T
prop = df[prop_col].to_numpy(dtype=np.float64)
else:
raise ValueError(f"Property column '{prop_col}' not found in file. "
f"Available columns: {', '.join(df.columns)}")
f"\n -> Available columns: {', '.join(df.columns)}")
else:
if prop_col >= len(df.columns):
raise ValueError(f"Property column index {prop_col} out of bounds (file has {len(df.columns)} columns)")
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment