@@ -34,10 +34,9 @@ def r_import(args):
34
34
def r_export (args ):
35
35
database .dumpModelToFile (args .database , args .file , args .id )
36
36
37
- def r_list (args ):
38
- all_models = database .getModels (args .database , 'R' )
39
- table = [a [:- 1 ] for a in all_models ]
40
- print tabulate (table , headers = ['ID' , 'Description' , 'Created' ])
37
+ def list_models (args ):
38
+ all_models = database .getModels (args .database )
39
+ print tabulate (all_models , headers = ['ID' , 'Description' , 'Created' , 'Source' ])
41
40
42
41
def trainModel (args ):
43
42
print "Training the model..."
@@ -346,6 +345,10 @@ def convert(args):
346
345
help = 'transform a model into a different file format' ,
347
346
description = 'Transform a model into a different file format' )
348
347
convert_parser .set_defaults (func = convert )
348
+ list_model_parser = subparsers .add_parser ('list' ,
349
+ help = 'list available models in the Eiger DB' ,
350
+ description = 'List available models in the Eiger DB' )
351
+ list_model_parser .set_defaults (func = list_models )
349
352
r_parser = subparsers .add_parser ('R' ,
350
353
help = 'interact with the R language for modeling' ,
351
354
description = 'Interact with the R language for modeling' )
@@ -417,6 +420,9 @@ def convert(args):
417
420
help = 'Name of input model to convert from' )
418
421
convert_parser .add_argument ('output' , type = str ,
419
422
help = 'Name of output model to convert to' )
423
+
424
+ """LIST-MODEL ARGUMENTS"""
425
+ list_model_parser .add_argument ('database' , type = str , help = 'Name of the database file' )
420
426
421
427
"""R-MODEL ARGUMENTS"""
422
428
r_subparser = r_parser .add_subparsers (title = 'subcommands' )
@@ -443,12 +449,6 @@ def convert(args):
443
449
help = 'ID number identifying which model in the database to export ' )
444
450
r_export_parser .add_argument ('file' , type = str ,
445
451
help = 'Name of the file to export into' )
446
- """R LIST ARGUMENTS"""
447
- r_list_parser = r_subparser .add_parser ('list' ,
448
- help = 'list available models in the Eiger DB' ,
449
- description = 'List available models in the Eiger DB' )
450
- r_list_parser .set_defaults (func = r_list )
451
- r_list_parser .add_argument ('database' , type = str , help = 'Name of the database file' )
452
452
453
453
args = parser .parse_args ()
454
454
args .func (args )
0 commit comments