@@ -200,12 +200,16 @@ def make_artifacts(
200200
201201
202202@click .command ()
203+ @click .argument (
204+ "model_specification" ,
205+ type = click .Path (exists = True , dir_okay = False , resolve_path = True ),
206+ )
203207@click .option (
204- "-m " ,
205- "--model_specifications " ,
208+ "-a " ,
209+ "--additional-model-specifications " ,
206210 multiple = True ,
207- required = True ,
208- help = "Model specification files (supports glob patterns). Can be specified multiple times." ,
211+ type = click . Path ( exists = True , dir_okay = False , resolve_path = True ) ,
212+ help = "Additional model specification files (supports glob patterns). Can be specified multiple times." ,
209213)
210214@click .option (
211215 "-r" ,
@@ -217,8 +221,9 @@ def make_artifacts(
217221@click .option (
218222 "-b" ,
219223 "--baseline-model-runs" ,
224+ default = 3 ,
225+ show_default = True ,
220226 type = int ,
221- required = True ,
222227 help = "Number of runs for baseline model." ,
223228)
224229@click .option (
@@ -242,7 +247,8 @@ def make_artifacts(
242247 help = "Drop into python debugger if an error occurs." ,
243248)
244249def run_benchmark (
245- model_specifications : tuple [str , ...],
250+ model_specification : str ,
251+ additional_model_specifications : tuple [str , ...],
246252 model_runs : int ,
247253 baseline_model_runs : int ,
248254 output_dir : str ,
@@ -255,11 +261,21 @@ def run_benchmark(
255261 This command profiles multiple model specifications and collects runtime
256262 and memory usage statistics. Results are saved to a timestamped CSV file.
257263
264+ The baseline model specification is provided as a positional argument.
265+ Additional model specifications can be provided with -a.
266+
258267 Example usage:
259- run_benchmark -m "model_spec_baseline.yaml" -m "model_spec_*.yaml" -r 10 -b 20
268+ run_benchmark model_spec_baseline.yaml -b 20
269+
270+ run_benchmark model_spec_baseline.yaml -a model_spec_2x.yaml -a model_spec_4x.yaml -r 10 -b 20
260271 """
261- # Expand model patterns
262- model_specifications = _expand_model_specs (list (model_specifications ))
272+ configure_logging_to_terminal (verbose )
273+
274+ baseline_path = Path (model_specification )
275+
276+ # Expand additional model specs (supporting glob patterns)
277+ additional_paths = _expand_model_specs (list (additional_model_specifications ))
278+ model_specifications = [str (baseline_path )] + [str (p ) for p in additional_paths ]
263279
264280 # Run benchmarks with error handling
265281 main = handle_exceptions (run_benchmark_loop , logger , with_debugger = with_debugger )
@@ -274,7 +290,22 @@ def run_benchmark(
274290
275291
276292def _expand_model_specs (model_patterns : list [str ]) -> list [Path ]:
277- """Expand glob patterns and validate model spec files."""
293+ """Expand glob patterns and validate model spec files.
294+
295+ Parameters
296+ ----------
297+ model_patterns
298+ List of file paths or glob patterns.
299+
300+ Returns
301+ -------
302+ List of resolved Path objects for existing files. Returns empty list
303+ if no patterns provided.
304+
305+ """
306+ if not model_patterns :
307+ return []
308+
278309 models = []
279310 for pattern in model_patterns :
280311 expanded = glob .glob (pattern )
@@ -287,11 +318,6 @@ def _expand_model_specs(model_patterns: list[str]) -> list[Path]:
287318 if path .is_file ():
288319 models .append (path )
289320
290- if not models :
291- raise click .ClickException (
292- f"No model specification files found for patterns: { model_patterns } "
293- )
294-
295321 return models
296322
297323
0 commit comments