Skip to content

Commit 0e22633

Browse files
authored
Fix missing driver name from eval result (#3)
1 parent 6bb8441 commit 0e22633

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

src/parxyval/cli/commands/evaluate.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@ def evaluate(
107107

108108
console = Console()
109109

110+
# Driver name is based on the input folder, assuming that the folder name follows the convention
111+
driver_name = (
112+
os.path.basename(os.path.normpath(input_folder)).replace(' ', '_').lower()
113+
)
114+
110115
logging.debug(f'Input folder: {input_folder}')
111116
logging.debug(f'Output folder: {output_folder}')
112117
logging.debug(f'Metrics: {metrics_name}')
@@ -115,6 +120,9 @@ def evaluate(
115120
files = os.listdir(input_folder)
116121
total_files = len(files)
117122

123+
print(f'Evaluate {driver_name} from {input_folder}')
124+
print()
125+
118126
res_list = []
119127
with Progress(
120128
SpinnerColumn(),
@@ -165,9 +173,7 @@ def evaluate(
165173

166174
timestamp_str = str(time.time()).replace('.', '')
167175
res_df = pd.DataFrame(res_list)
168-
input_folder_name = input_folder.replace(os.sep, '/').replace('\\', '/')
169-
input_folder_name = input_folder_name.split('/')[-1].replace(' ', '_').lower()
170-
output_file = f'eval_{input_folder_name}_{timestamp_str}.csv'
176+
output_file = f'eval_{driver_name}_{timestamp_str}.csv'
171177
output_path = os.path.join(output_folder, output_file)
172178
res_df.to_csv(output_path, index=False)
173179

0 commit comments

Comments
 (0)