@@ -397,78 +397,88 @@ def model_output_update(
397397 click .echo ("Parameters of MO updated" )
398398
399399
400- @click .command ("update " )
400+ @click .command ("list " )
401401@click .argument ("model_output_id" )
402402@click .argument ("exp_id" )
403- @click .argument ("benchmarks" , default = "" , callback = _parse_csv )
404- def model_benchmark_update (model_output_id : str , exp_id : str , benchmarks : str ):
405- """Update model benchmark
403+ def model_output_benchmarks_list (model_output_id : str , exp_id : str ):
404+ """List model benchmarks.
406405
407406 Parameters
408407 ----------
409408 model_output_id : str
410- _description_
409+ Model output ID
411410 exp_id : str
412- _description_
413- benchmarks : list[str]
414- _description_
411+ Experiment ID
415412 """
416413 client = _get_client ()
417- _ = _call (
418- client .model_output_replace_benchmarks ,
414+ response = _call (
415+ client .model_output_benchmarks_list ,
419416 model_id = model_output_id ,
420417 exp_id = exp_id ,
421- updated_benchmarks = benchmarks ,
422418 )
423419
424420 if client .success ():
425- click .echo ("Benchmark updated" )
421+ click .echo (
422+ f"List of available benchmarks: { json .dumps (response .get ("data" ).get ("benchmarks" ), indent = 4 )} "
423+ )
424+ click .echo (
425+ f"List of linked benchmarks: { json .dumps (response .get ("data" ).get ("current" ), indent = 4 )} "
426+ )
426427
428+ return response .get ("data" )
427429
428- @click .command ("list" )
430+
431+ @click .command ("update" )
429432@click .argument ("model_output_id" )
430433@click .argument ("exp_id" )
431- def model_benchmark_list (model_output_id : str , exp_id : str ):
432- """List model benchmarks
434+ @click .argument ("benchmark_ids" , default = "" , callback = _parse_csv )
435+ def model_output_benchmarks_replace (
436+ model_output_id : str , exp_id : str , benchmark_ids : str
437+ ):
438+ """
439+ Change benchmarks associated with Model output and Experiment.
433440
434441 Parameters
435442 ----------
436443 model_output_id : str
437- _description_
444+ Model output ID
438445 exp_id : str
439- _description_
446+ Experiment ID
440447 benchmarks : list[str]
441- _description_
448+ List of benchmarks IDs to fully replace existing
442449 """
443450 client = _get_client ()
444- response = _call (
445- client .model_output_list_benchmarks ,
451+ _ = _call (
452+ client .model_output_benchmarks_replace ,
446453 model_id = model_output_id ,
447454 exp_id = exp_id ,
455+ updated_benchmarks = benchmark_ids ,
448456 )
449457
450458 if client .success ():
451- click .echo (response )
459+ click .echo ("Benchmark updated" )
452460
453461
454462@click .command ("update" )
455463@click .argument ("model_output_id" )
456- @click .argument ("experiments" , default = "" , callback = _parse_csv )
457- def model_experiments_extend (model_output_id : str , experiments : str ):
458- """Update experiment associated with model output
464+ @click .argument ("exp_ids" , default = "" , callback = _parse_csv )
465+ def model_output_experiments_extend (model_output_id : str , exp_ids : list [str ]):
466+ """
467+ Extend existing set of experiment associations.
459468
460469 Parameters
461470 ----------
462471 model_output_id : str
463- _description_
472+ Model output ID
473+
464474 experiments : list[str]
465- _description_
475+ List of experiment IDs
466476 """
467477 client = _get_client ()
468478 _ = _call (
469- client .model_output_extend_experiments ,
479+ client .model_output_experiments_extend ,
470480 model_id = model_output_id ,
471- updated_experiments = experiments ,
481+ updated_experiments = exp_ids ,
472482 )
473483
474484 if client .success ():
@@ -478,23 +488,24 @@ def model_experiments_extend(model_output_id: str, experiments: str):
478488@click .command ("delete" )
479489@click .argument ("model_output_id" )
480490@click .argument ("exp_id" )
481- def model_experiment_delete (model_output_id : str , exp_id : str ):
491+ def model_output_experiment_delete (model_output_id : str , exp_id : str ):
482492 """Delete specific experiment associated with model output
483493
484494 Parameters
485495 ----------
486496 model_output_id : str
487- _description_
488- experiment_id : str
489- _description_
497+ Model output ID
498+
499+ experiment : str
500+ Experiment IDs
490501 """
491502 client = _get_client ()
492503 _ = _call (
493- client .model_output_delete_experiment , model_id = model_output_id , exp_id = exp_id
504+ client .model_output_experiment_delete , model_id = model_output_id , exp_id = exp_id
494505 )
495506
496507 if client .success ():
497- click .echo ("Experiments deleted" )
508+ click .echo (f"Experiment ID: { exp_id } deleted" )
498509
499510
500511@click .command ("delete" )
@@ -633,12 +644,12 @@ def cli_model_experiments():
633644cli_model_output .add_command (model_output_delete )
634645
635646# Benchmarks command
636- cli_model_benchmark .add_command (model_benchmark_list )
637- cli_model_benchmark .add_command (model_benchmark_update )
647+ cli_model_benchmark .add_command (model_output_benchmarks_list )
648+ cli_model_benchmark .add_command (model_output_benchmarks_replace )
638649
639650# Experiments command
640- cli_model_experiments .add_command (model_experiments_extend )
641- cli_model_experiments .add_command (model_experiment_delete )
651+ cli_model_experiments .add_command (model_output_experiments_extend )
652+ cli_model_experiments .add_command (model_output_experiment_delete )
642653
643654# Add subparsers to the master
644655cli .add_command (cli_endpoints )
0 commit comments