Skip to content
Snippets Groups Projects
Commit 50525939 authored by Theophile GENTILHOMME's avatar Theophile GENTILHOMME
Browse files

[script/test][commands,figure,test_commands] Modify --title option to

--titles

Allows a list of titles
parent 03022ced
No related branches found
No related tags found
1 merge request!160Titltes
Pipeline #
......@@ -69,7 +69,7 @@ def metrics(ctx, scores, evaluation, **kargs):
@click.command()
@common_options.scores_argument(nargs=-1)
@common_options.title_option()
@common_options.titles_option()
@common_options.legends_option()
@common_options.legend_loc_option(dflt=None)
@common_options.no_legend_option()
......@@ -117,7 +117,7 @@ def roc(ctx, scores, evaluation, **kargs):
@click.command()
@common_options.scores_argument(nargs=-1)
@common_options.title_option()
@common_options.titles_option()
@common_options.output_plot_file_option(default_out='det.pdf')
@common_options.legends_option()
@common_options.legend_loc_option(dflt='upper-right')
......@@ -163,7 +163,7 @@ def det(ctx, scores, evaluation, **kargs):
@click.command()
@common_options.scores_argument(min_arg=1, force_eval=True, nargs=-1)
@common_options.title_option()
@common_options.titles_option()
@common_options.output_plot_file_option(default_out='epc.pdf')
@common_options.legends_option()
@common_options.legend_loc_option(dflt='upper-center')
......@@ -197,7 +197,7 @@ def epc(ctx, scores, **kargs):
@click.command()
@common_options.scores_argument(nargs=-1)
@common_options.title_option()
@common_options.titles_option()
@common_options.legends_option()
@common_options.sep_dev_eval_option()
@common_options.output_plot_file_option(default_out='cmc.pdf')
......@@ -240,7 +240,7 @@ def cmc(ctx, scores, evaluation, **kargs):
@click.command()
@common_options.scores_argument(nargs=-1)
@common_options.title_option()
@common_options.titles_option()
@common_options.legends_option()
@common_options.sep_dev_eval_option()
@common_options.output_plot_file_option(default_out='dir.pdf')
......@@ -293,7 +293,6 @@ def dir(ctx, scores, evaluation, **kargs):
@click.command()
@common_options.scores_argument(nargs=-1)
@common_options.title_option()
@common_options.output_plot_file_option(default_out='hist.pdf')
@common_options.eval_option()
@common_options.n_bins_option()
......
......@@ -31,7 +31,7 @@ class Cmc(measure_figure.PlotBase):
def __init__(self, ctx, scores, evaluation, func_load):
super(Cmc, self).__init__(ctx, scores, evaluation, func_load)
self._semilogx = ctx.meta.get('semilogx', True)
self._title = self._title or 'CMC'
self._titles = self._titles or ['CMC dev', 'CMC eval']
self._x_label = self._x_label or 'Rank'
self._y_label = self._y_label or 'Identification rate'
self._max_R = 0
......@@ -45,7 +45,7 @@ class Cmc(measure_figure.PlotBase):
rank = plot.cmc(
input_scores[0], logx=self._semilogx,
color=self._colors[idx], linestyle=linestyle,
label=self._label('development', input_names[0], idx)
label=self._label('dev', input_names[0], idx)
)
self._max_R = max(rank, self._max_R)
linestyle = '--'
......@@ -63,7 +63,7 @@ class Cmc(measure_figure.PlotBase):
rank = plot.cmc(
input_scores[0], logx=self._semilogx,
color=self._colors[idx], linestyle=self._linestyles[idx],
label=self._label('development', input_names[0], idx)
label=self._label('dev', input_names[0], idx)
)
self._max_R = max(rank, self._max_R)
......@@ -75,7 +75,7 @@ class Dir(measure_figure.PlotBase):
super(Dir, self).__init__(ctx, scores, evaluation, func_load)
self._semilogx = ctx.meta.get('semilogx', True)
self._rank = ctx.meta.get('rank', 1)
self._title = self._title or 'DIR curve'
self._titles = self._titles or ['DIR curve'] * 2
self._x_label = self._x_label or 'False Alarm Rate'
self._y_label = self._y_label or 'Detection and Identification Rate'
......@@ -88,7 +88,7 @@ class Dir(measure_figure.PlotBase):
plot.detection_identification_curve(
input_scores[0], rank=self._rank, logx=self._semilogx,
color=self._colors[idx], linestyle=linestyle,
label=self._label('development', input_names[0], idx)
label=self._label('dev', input_names[0], idx)
)
linestyle = '--'
if self._split:
......@@ -104,7 +104,7 @@ class Dir(measure_figure.PlotBase):
plot.detection_identification_curve(
input_scores[0], rank=self._rank, logx=self._semilogx,
color=self._colors[idx], linestyle=self._linestyles[idx],
label=self._label('development', input_names[0], idx)
label=self._label('dev', input_names[0], idx)
)
if self._min_dig is not None:
......
......@@ -272,6 +272,7 @@ def test_cmc():
with runner.isolated_filesystem():
result = runner.invoke(commands.cmc, ['--output', 'test.pdf',
'--legends', 'A,B', '-S',
'-ts', 'TA,TB',
dev1, test1, dev1, test1])
if result.output:
click.echo(result.output)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment