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

Add rank click option

parent 09a4d170
Branches
Tags
2 merge requests!54Refactors the score loading and scripts functionality,!52generic plotting script for bob measure
Pipeline #
...@@ -311,6 +311,18 @@ def threshold_option(**kwargs): ...@@ -311,6 +311,18 @@ def threshold_option(**kwargs):
callback=callback, show_default=True,**kwargs)(func) callback=callback, show_default=True,**kwargs)(func)
return custom_threshold_option return custom_threshold_option
def rank_option(**kwargs):
'''Get option for rank parameter'''
def custom_rank_option(func):
def callback(ctx, param, value):
value = 1 if value < 0 else value
ctx.meta['rank'] = value
return value
return click.option(
'--rank', type=click.INT, default=1,
help='Given threshold for metrics computations',
callback=callback, show_default=True,**kwargs)(func)
return custom_rank_option
def label_option(name_option='x_label', **kwargs): def label_option(name_option='x_label', **kwargs):
'''Get labels options based on the given name. '''Get labels options based on the given name.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment