File tree Expand file tree Collapse file tree
src/lightspeed_evaluation/runner Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2828import numpy as np
2929import yaml
3030
31- from lightspeed_evaluation .runner .evaluation import run_evaluation
31+ from lightspeed_evaluation .runner .evaluation import create_eval_parser , run_evaluation
3232
3333# Configure logging
3434logging .basicConfig (
@@ -128,11 +128,17 @@ def _run_evaluation_worker(
128128 temp_file .close ()
129129
130130 # Run evaluation
131- summary = run_evaluation (
132- system_config_path = str (temp_config_path ),
133- evaluation_data_path = eval_data_path ,
134- output_dir = str (output_dir ),
131+ eval_args = create_eval_parser ().parse_args (
132+ [
133+ "--system-config" ,
134+ str (temp_config_path ),
135+ "--eval-data" ,
136+ eval_data_path ,
137+ "--output-dir" ,
138+ str (output_dir ),
139+ ]
135140 )
141+ summary = run_evaluation (eval_args )
136142
137143 # Check result
138144 if summary is not None :
@@ -473,11 +479,17 @@ def _run_single_evaluation(
473479 logger .debug (f"Output directory: { output_dir } " )
474480
475481 # Run evaluation by calling the function directly
476- summary = run_evaluation (
477- system_config_path = str (temp_config_path ),
478- evaluation_data_path = str (self .eval_data_path ),
479- output_dir = str (output_dir ),
482+ eval_args = create_eval_parser ().parse_args (
483+ [
484+ "--system-config" ,
485+ str (temp_config_path ),
486+ "--eval-data" ,
487+ str (self .eval_data_path ),
488+ "--output-dir" ,
489+ str (output_dir ),
490+ ]
480491 )
492+ summary = run_evaluation (eval_args )
481493
482494 # Check result
483495 if summary is not None :
Original file line number Diff line number Diff line change @@ -235,8 +235,8 @@ def run_evaluation( # pylint: disable=too-many-locals
235235 return None
236236
237237
238- def main () -> int :
239- """Command line interface ."""
238+ def create_eval_parser () -> argparse . ArgumentParser :
239+ """Create the argument parser for the evaluation runner ."""
240240 parser = argparse .ArgumentParser (
241241 description = "LightSpeed Evaluation Framework / Tool" ,
242242 )
@@ -274,8 +274,12 @@ def main() -> int:
274274 action = "store_true" ,
275275 help = "Enable cache warmup mode - rebuild caches without reading existing entries" ,
276276 )
277+ return parser
278+
277279
278- eval_args = parser .parse_args ()
280+ def main () -> int :
281+ """Command line interface."""
282+ eval_args = create_eval_parser ().parse_args ()
279283
280284 summary = run_evaluation (eval_args )
281285 return 0 if summary is not None else 1
You can’t perform that action at this time.
0 commit comments