Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
bob
bob.measure
Commits
2971f262
Commit
2971f262
authored
May 25, 2018
by
Amir MOHAMMADI
Browse files
Merge branch 'modifoption' into 'master'
Modification of criterion_option See merge request
!65
parents
18c8385d
facbbd89
Pipeline
#20518
passed with stages
in 12 minutes and 21 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
bob/measure/script/common_options.py
View file @
2971f262
...
...
@@ -310,9 +310,9 @@ def criterion_option(lcriteria=['eer', 'min-hter', 'far'], **kwargs):
List of possible criteria
"""
def
custom_criterion_option
(
func
):
list_accepted_crit
=
lcriteria
if
lcriteria
is
not
None
else
\
[
'eer'
,
'min-hter'
,
'far'
]
def
callback
(
ctx
,
param
,
value
):
list_accepted_crit
=
lcriteria
if
lcriteria
is
not
None
else
\
[
'eer'
,
'min-hter'
,
'far'
]
if
value
not
in
list_accepted_crit
:
raise
click
.
BadParameter
(
'Incorrect value for `--criterion`. '
'Must be one of [`%s`]'
%
...
...
@@ -322,7 +322,7 @@ def criterion_option(lcriteria=['eer', 'min-hter', 'far'], **kwargs):
return
click
.
option
(
'-c'
,
'--criterion'
,
default
=
'eer'
,
help
=
'Criterion to compute plots and '
'metrics:
`eer`, `min-hter` or `far`'
,
'metrics:
%s)'
%
', '
.
join
(
list_accepted_crit
)
,
callback
=
callback
,
is_eager
=
True
,
**
kwargs
)(
func
)
return
custom_criterion_option
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment