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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
bob
bob.measure
Commits
086a8c08
Commit
086a8c08
authored
5 years ago
by
Amir MOHAMMADI
Browse files
Options
Downloads
Patches
Plain Diff
[click] make threshold criteria checking optional
parent
23475f4f
No related branches found
No related tags found
No related merge requests found
Pipeline
#36781
passed
5 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/measure/script/common_options.py
+10
-6
10 additions, 6 deletions
bob/measure/script/common_options.py
with
10 additions
and
6 deletions
bob/measure/script/common_options.py
+
10
−
6
View file @
086a8c08
...
@@ -498,7 +498,7 @@ def no_line_option(**kwargs):
...
@@ -498,7 +498,7 @@ def no_line_option(**kwargs):
return
custom_no_line_option
return
custom_no_line_option
def
criterion_option
(
lcriteria
=
[
"
eer
"
,
"
min-hter
"
,
"
far
"
],
**
kwargs
):
def
criterion_option
(
lcriteria
=
[
"
eer
"
,
"
min-hter
"
,
"
far
"
],
check
=
True
,
**
kwargs
):
"""
Get option flag to tell which criteriom is used (default:eer)
"""
Get option flag to tell which criteriom is used (default:eer)
Parameters
Parameters
...
@@ -513,7 +513,7 @@ def criterion_option(lcriteria=["eer", "min-hter", "far"], **kwargs):
...
@@ -513,7 +513,7 @@ def criterion_option(lcriteria=["eer", "min-hter", "far"], **kwargs):
)
)
def
callback
(
ctx
,
param
,
value
):
def
callback
(
ctx
,
param
,
value
):
if
value
not
in
list_accepted_crit
:
if
value
not
in
list_accepted_crit
and
check
:
raise
click
.
BadParameter
(
raise
click
.
BadParameter
(
"
Incorrect value for `--criterion`.
"
"
Incorrect value for `--criterion`.
"
"
Must be one of [`%s`]
"
%
"
`, `
"
.
join
(
list_accepted_crit
)
"
Must be one of [`%s`]
"
%
"
`, `
"
.
join
(
list_accepted_crit
)
...
@@ -536,7 +536,7 @@ def criterion_option(lcriteria=["eer", "min-hter", "far"], **kwargs):
...
@@ -536,7 +536,7 @@ def criterion_option(lcriteria=["eer", "min-hter", "far"], **kwargs):
return
custom_criterion_option
return
custom_criterion_option
def
decimal_option
(
dflt
=
1
,
**
kwargs
):
def
decimal_option
(
dflt
=
1
,
short
=
"
-d
"
,
**
kwargs
):
"""
Get option to get decimal value
"""
"""
Get option to get decimal value
"""
def
custom_decimal_option
(
func
):
def
custom_decimal_option
(
func
):
...
@@ -545,7 +545,7 @@ def decimal_option(dflt=1, **kwargs):
...
@@ -545,7 +545,7 @@ def decimal_option(dflt=1, **kwargs):
return
value
return
value
return
click
.
option
(
return
click
.
option
(
"
-d
"
,
short
,
"
--decimal
"
,
"
--decimal
"
,
type
=
click
.
INT
,
type
=
click
.
INT
,
default
=
dflt
,
default
=
dflt
,
...
@@ -865,7 +865,11 @@ def style_option(**kwargs):
...
@@ -865,7 +865,11 @@ def style_option(**kwargs):
def
metrics_command
(
def
metrics_command
(
docstring
,
criteria
=
(
"
eer
"
,
"
min-hter
"
,
"
far
"
),
far_name
=
"
FAR
"
,
**
kwarg
docstring
,
criteria
=
(
"
eer
"
,
"
min-hter
"
,
"
far
"
),
far_name
=
"
FAR
"
,
check_criteria
=
True
,
**
kwarg
):
):
def
custom_metrics_command
(
func
):
def
custom_metrics_command
(
func
):
func
.
__doc__
=
docstring
func
.
__doc__
=
docstring
...
@@ -875,7 +879,7 @@ def metrics_command(
...
@@ -875,7 +879,7 @@ def metrics_command(
@eval_option
()
@eval_option
()
@table_option
()
@table_option
()
@output_log_metric_option
()
@output_log_metric_option
()
@criterion_option
(
criteria
)
@criterion_option
(
criteria
,
check
=
check_criteria
)
@thresholds_option
()
@thresholds_option
()
@far_option
(
far_name
=
far_name
)
@far_option
(
far_name
=
far_name
)
@legends_option
()
@legends_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