mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-04 23:09:44 +01:00
dvc: introduce -m option for repro
Fixes #188 Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
@@ -245,6 +245,11 @@ def parse_args(argv=None):
|
||||
'--cwd',
|
||||
default=os.path.curdir,
|
||||
help='Directory to reproduce from.')
|
||||
repro_parser.add_argument('-m',
|
||||
'--metrics',
|
||||
action='store_true',
|
||||
default=False,
|
||||
help='Show metrics after reproduction')
|
||||
repro_parser.set_defaults(func=CmdRepro)
|
||||
|
||||
# Remove
|
||||
|
||||
+5
-10
@@ -3,16 +3,11 @@ from dvc.command.common.base import CmdBase
|
||||
|
||||
class CmdMetricsShow(CmdBase):
|
||||
def run(self):
|
||||
res = self.project.metrics_show(self.args.path,
|
||||
json_path=self.args.json_path,
|
||||
tsv_path=self.args.tsv_path,
|
||||
htsv_path=self.args.htsv_path,
|
||||
all_branches=self.args.all_branches)
|
||||
for branch, val in res.items():
|
||||
self.project.logger.info('{}:'.format(branch))
|
||||
for fname, metric in val.items():
|
||||
self.project.logger.info('\t{}: {}'.format(fname, metric))
|
||||
|
||||
self.project.metrics_show(self.args.path,
|
||||
json_path=self.args.json_path,
|
||||
tsv_path=self.args.tsv_path,
|
||||
htsv_path=self.args.htsv_path,
|
||||
all_branches=self.args.all_branches)
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ class CmdRepro(CmdBase):
|
||||
self.project.reproduce(target,
|
||||
recursive=recursive,
|
||||
force=self.args.force)
|
||||
if self.args.metrics:
|
||||
self.project.metrics_show()
|
||||
except ReproductionError as ex:
|
||||
msg = 'Failed to reproduce \'{}\''.format(target)
|
||||
self.project.logger.error(msg, ex)
|
||||
|
||||
@@ -359,6 +359,12 @@ class Project(object):
|
||||
|
||||
self.scm.checkout(saved)
|
||||
self.checkout()
|
||||
|
||||
for branch, val in res.items():
|
||||
self.logger.info('{}:'.format(branch))
|
||||
for fname, metric in val.items():
|
||||
self.logger.info('\t{}: {}'.format(fname, metric))
|
||||
|
||||
return res
|
||||
|
||||
def _metrics_modify(self, path, val):
|
||||
|
||||
Reference in New Issue
Block a user