From 3ed5efceb7e9edec2e7cadb2d5fbec3a7bc389c6 Mon Sep 17 00:00:00 2001 From: Saugat Pachhai Date: Fri, 8 Oct 2021 12:18:28 +0545 Subject: [PATCH] move defaults to the class level (#6762) --- dvc/command/experiments.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dvc/command/experiments.py b/dvc/command/experiments.py index f40adfc86..f4b85e045 100644 --- a/dvc/command/experiments.py +++ b/dvc/command/experiments.py @@ -787,6 +787,15 @@ class CmdExperimentsInit(CmdBase): DEFAULT_PARAMS = "params.yaml" PLOTS = "plots" DVCLIVE = "dvclive" + DEFAULTS = { + "code": CODE, + "data": DATA, + "models": MODELS, + "metrics": DEFAULT_METRICS, + "params": DEFAULT_PARAMS, + "plots": PLOTS, + "live": DVCLIVE, + } def run(self): from dvc.command.stage import parse_cmd @@ -797,19 +806,10 @@ class CmdExperimentsInit(CmdBase): from dvc.repo.experiments.init import init - global_defaults = { - "code": self.CODE, - "data": self.DATA, - "models": self.MODELS, - "metrics": self.DEFAULT_METRICS, - "params": self.DEFAULT_PARAMS, - "plots": self.PLOTS, - "live": self.DVCLIVE, - } defaults = {} if not self.args.explicit: config = {} # TODO - defaults.update({**global_defaults, **config}) + defaults.update({**self.DEFAULTS, **config}) cli_args = compact( {