Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.cmdline
Commits
611ccc72
Commit
611ccc72
authored
Jul 13, 2018
by
Flavio TARSETTI
Browse files
Merge branch 'experiment_quiet_option' into '1.4.x'
Add option to make experiment run less verbose See merge request
!43
parents
8baa8fbe
5c3023ae
Pipeline
#21854
passed with stages
in 34 minutes and 41 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
beat/cmdline/experiments.py
View file @
611ccc72
...
...
@@ -52,7 +52,7 @@ from .click_helper import AliasedGroup
logger
=
logging
.
getLogger
(
__name__
)
def
run_experiment
(
configuration
,
name
,
force
,
use_docker
,
use_local
):
def
run_experiment
(
configuration
,
name
,
force
,
use_docker
,
use_local
,
quiet
):
'''Run experiments locally'''
def
load_result
(
executor
):
...
...
@@ -197,7 +197,7 @@ def run_experiment(configuration, name, force, use_docker, use_local):
if
executor
.
outputs_exist
and
not
force
:
logger
.
info
(
"Skipping execution of `%s' for block `%s' "
"- outputs exist"
,
executor
.
algorithm
.
name
,
key
)
if
executor
.
analysis
:
if
executor
.
analysis
and
not
quiet
:
logger
.
extra
(
" Outputs produced:"
)
print_results
(
executor
)
continue
...
...
@@ -256,15 +256,18 @@ def run_experiment(configuration, name, force, use_docker, use_local):
else
:
logger
.
extra
(
" Environment: %s"
%
'local environment'
)
if
executor
.
analysis
:
print_results
(
executor
)
if
not
quiet
:
if
executor
.
analysis
:
print_results
(
executor
)
logger
.
extra
(
" Outputs produced:"
)
if
executor
.
analysis
:
logger
.
extra
(
" * %s"
,
executor
.
data
[
'result'
][
'path'
])
logger
.
extra
(
" Outputs produced:"
)
if
executor
.
analysis
:
logger
.
extra
(
" * %s"
,
executor
.
data
[
'result'
][
'path'
])
else
:
for
name
,
details
in
executor
.
data
[
'outputs'
].
items
():
logger
.
extra
(
" * %s"
,
details
[
'path'
])
else
:
for
name
,
details
in
executor
.
data
[
'outputs'
].
items
():
logger
.
extra
(
" * %s"
,
details
[
'path'
])
logger
.
info
(
"Done"
)
return
0
...
...
@@ -556,12 +559,14 @@ def experiments(ctx):
@
click
.
option
(
'--local'
,
help
=
'Uses the local executor to execute the '
'experiment on the local machine (default)'
,
default
=
True
,
is_flag
=
True
)
@
click
.
option
(
'--quiet'
,
help
=
'Be less verbose'
,
is_flag
=
True
)
@
click
.
pass_context
@
raise_on_error
def
run
(
ctx
,
name
,
force
,
docker
,
local
):
def
run
(
ctx
,
name
,
force
,
docker
,
local
,
quiet
):
''' Runs an experiment locally'''
config
=
ctx
.
meta
.
get
(
'config'
)
return
run_experiment
(
config
,
name
,
force
,
docker
,
local
or
True
)
return
run_experiment
(
config
,
name
,
force
,
docker
,
local
,
quiet
)
@
experiments
.
command
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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