Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.measure
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.measure
Commits
facbbd89
There was a problem fetching the pipeline summary.
Commit
facbbd89
authored
7 years ago
by
Theophile GENTILHOMME
Browse files
Options
Downloads
Patches
Plain Diff
[script][common_options] Modification of criterion_option
Correct display of available criteria
parent
18c8385d
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!65
Modification of criterion_option
Pipeline
#
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/measure/script/common_options.py
+3
-3
3 additions, 3 deletions
bob/measure/script/common_options.py
with
3 additions
and
3 deletions
bob/measure/script/common_options.py
+
3
−
3
View file @
facbbd89
...
@@ -310,9 +310,9 @@ def criterion_option(lcriteria=['eer', 'min-hter', 'far'], **kwargs):
...
@@ -310,9 +310,9 @@ def criterion_option(lcriteria=['eer', 'min-hter', 'far'], **kwargs):
List of possible criteria
List of possible criteria
"""
"""
def
custom_criterion_option
(
func
):
def
custom_criterion_option
(
func
):
def
callback
(
ctx
,
param
,
value
):
list_accepted_crit
=
lcriteria
if
lcriteria
is
not
None
else
\
list_accepted_crit
=
lcriteria
if
lcriteria
is
not
None
else
\
[
'
eer
'
,
'
min-hter
'
,
'
far
'
]
[
'
eer
'
,
'
min-hter
'
,
'
far
'
]
def
callback
(
ctx
,
param
,
value
):
if
value
not
in
list_accepted_crit
:
if
value
not
in
list_accepted_crit
:
raise
click
.
BadParameter
(
'
Incorrect value for `--criterion`.
'
raise
click
.
BadParameter
(
'
Incorrect value for `--criterion`.
'
'
Must be one of [`%s`]
'
%
'
Must be one of [`%s`]
'
%
...
@@ -322,7 +322,7 @@ def criterion_option(lcriteria=['eer', 'min-hter', 'far'], **kwargs):
...
@@ -322,7 +322,7 @@ def criterion_option(lcriteria=['eer', 'min-hter', 'far'], **kwargs):
return
click
.
option
(
return
click
.
option
(
'
-c
'
,
'
--criterion
'
,
default
=
'
eer
'
,
'
-c
'
,
'
--criterion
'
,
default
=
'
eer
'
,
help
=
'
Criterion to compute plots and
'
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
)
callback
=
callback
,
is_eager
=
True
,
**
kwargs
)(
func
)
return
custom_criterion_option
return
custom_criterion_option
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment