From ec1b85d7a6f540cbb58aa67bb65a442dcb48e320 Mon Sep 17 00:00:00 2001 From: Theophile GENTILHOMME Date: Fri, 20 Apr 2018 15:34:51 +0200 Subject: [PATCH] Replace a force_eval option so that no evaluation option is needed when evaluation scores are mandatory --- bob/measure/script/commands.py | 2 +- bob/measure/script/common_options.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bob/measure/script/commands.py b/bob/measure/script/commands.py index 9c8ba05..61d650a 100644 --- a/bob/measure/script/commands.py +++ b/bob/measure/script/commands.py @@ -118,7 +118,7 @@ def det(ctx, scores, evaluation, **kwargs): process.run() @click.command() -@common_options.scores_argument(min_arg=2, nargs=-1) +@common_options.scores_argument(min_arg=1, force_eval=True, nargs=-1) @common_options.output_plot_file_option(default_out='epc.pdf') @common_options.title_option() @common_options.titles_option() diff --git a/bob/measure/script/common_options.py b/bob/measure/script/common_options.py index 94bbed8..19331f8 100644 --- a/bob/measure/script/common_options.py +++ b/bob/measure/script/common_options.py @@ -9,7 +9,7 @@ from bob.extension.scripts.click_helper import (bool_option, list_float_option) LOGGER = logging.getLogger(__name__) -def scores_argument(min_arg=1, **kwargs): +def scores_argument(min_arg=1, force_eval=False, **kwargs): """Get the argument for scores, and add `dev-scores` and `eval-scores` in the context when `--evaluation` flag is on (default) @@ -29,7 +29,7 @@ def scores_argument(min_arg=1, **kwargs): min_a = min_arg or 1 mutli = 1 error = '' - if 'evaluation' in ctx.meta and ctx.meta['evaluation']: + if ('evaluation' in ctx.meta and ctx.meta['evaluation']) or force_eval: mutli += 1 error += '- %d evaluation file(s) \n' % min_a if 'train' in ctx.meta and ctx.meta['train']: -- 2.21.0