mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-19 07:18:27 +01:00
live integration: rename report to html (#5366)
This commit is contained in:
+1
-1
@@ -44,7 +44,7 @@ class CmdRun(CmdBase):
|
||||
plots_no_cache=self.args.plots_no_cache,
|
||||
live=self.args.live,
|
||||
live_no_summary=self.args.live_no_summary,
|
||||
live_no_report=self.args.live_no_report,
|
||||
live_no_html=self.args.live_no_html,
|
||||
deps=self.args.deps,
|
||||
params=self.args.params,
|
||||
fname=self.args.file,
|
||||
|
||||
@@ -213,7 +213,7 @@ def _add_common_args(parser):
|
||||
help="Signal dvclive logger to not dump latest metrics file.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--live-no-report",
|
||||
"--live-no-html",
|
||||
action="store_true",
|
||||
default=False,
|
||||
help="Signal dvclive logger to not produce training report.",
|
||||
|
||||
+1
-1
@@ -4,5 +4,5 @@ DVC_PAGER = "DVC_PAGER"
|
||||
DVC_ROOT = "DVC_ROOT"
|
||||
DVCLIVE_PATH = "DVCLIVE_PATH"
|
||||
DVCLIVE_SUMMARY = "DVCLIVE_SUMMARY"
|
||||
DVCLIVE_REPORT = "DVCLIVE_REPORT"
|
||||
DVCLIVE_HTML = "DVCLIVE_HTML"
|
||||
DVCLIVE_RESUME = "DVCLIVE_RESUME"
|
||||
|
||||
+1
-1
@@ -79,7 +79,7 @@ class BaseOutput:
|
||||
PARAM_ISEXEC = "isexec"
|
||||
PARAM_LIVE = "live"
|
||||
PARAM_LIVE_SUMMARY = "summary"
|
||||
PARAM_LIVE_REPORT = "report"
|
||||
PARAM_LIVE_HTML = "html"
|
||||
|
||||
METRIC_SCHEMA = Any(
|
||||
None,
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ PLOT_PSTAGE_SCHEMA = {str: Any(PLOT_PROPS_SCHEMA, [PLOT_PROPS_SCHEMA])}
|
||||
|
||||
LIVE_PROPS = {
|
||||
BaseOutput.PARAM_LIVE_SUMMARY: bool,
|
||||
BaseOutput.PARAM_LIVE_REPORT: bool,
|
||||
BaseOutput.PARAM_LIVE_HTML: bool,
|
||||
}
|
||||
LIVE_PROPS_SCHEMA = {**PLOT_PROPS_SCHEMA, **LIVE_PROPS}
|
||||
LIVE_PSTAGE_SCHEMA = {str: LIVE_PROPS_SCHEMA}
|
||||
|
||||
@@ -267,7 +267,7 @@ class Stage(params.StageParams):
|
||||
def _read_env(self, out, checkpoint_func=None) -> Env:
|
||||
env: Env = {}
|
||||
if out.live:
|
||||
from dvc.env import DVCLIVE_PATH, DVCLIVE_REPORT, DVCLIVE_SUMMARY
|
||||
from dvc.env import DVCLIVE_HTML, DVCLIVE_PATH, DVCLIVE_SUMMARY
|
||||
from dvc.output import BaseOutput
|
||||
from dvc.schema import LIVE_PROPS
|
||||
|
||||
@@ -278,8 +278,8 @@ class Stage(params.StageParams):
|
||||
env[DVCLIVE_SUMMARY] = str(
|
||||
int(config.get(BaseOutput.PARAM_LIVE_SUMMARY, True))
|
||||
)
|
||||
env[DVCLIVE_REPORT] = str(
|
||||
int(config.get(BaseOutput.PARAM_LIVE_REPORT, True))
|
||||
env[DVCLIVE_HTML] = str(
|
||||
int(config.get(BaseOutput.PARAM_LIVE_HTML, True))
|
||||
)
|
||||
elif out.checkpoint and checkpoint_func:
|
||||
from dvc.env import DVC_CHECKPOINT
|
||||
|
||||
+3
-3
@@ -81,7 +81,7 @@ def fill_stage_outputs(stage, **kwargs):
|
||||
|
||||
|
||||
def _load_live_output(
|
||||
stage, live=None, live_summary=False, live_report=False, **kwargs
|
||||
stage, live=None, live_summary=False, live_html=False, **kwargs
|
||||
):
|
||||
from dvc.output import BaseOutput, loads_from
|
||||
|
||||
@@ -93,7 +93,7 @@ def _load_live_output(
|
||||
use_cache=False,
|
||||
live={
|
||||
BaseOutput.PARAM_LIVE_SUMMARY: live_summary,
|
||||
BaseOutput.PARAM_LIVE_REPORT: live_report,
|
||||
BaseOutput.PARAM_LIVE_HTML: live_html,
|
||||
},
|
||||
)
|
||||
|
||||
@@ -364,7 +364,7 @@ def create_stage_from_cli(
|
||||
|
||||
kwargs["cmd"] = cmd[0] if isinstance(cmd, list) and len(cmd) == 1 else cmd
|
||||
kwargs["live_summary"] = not kwargs.pop("live_no_summary", False)
|
||||
kwargs["live_report"] = not kwargs.pop("live_no_report", False)
|
||||
kwargs["live_html"] = not kwargs.pop("live_no_html", False)
|
||||
|
||||
params = chunk_dict(parse_params(kwargs.pop("params", [])))
|
||||
stage = create_stage(
|
||||
|
||||
@@ -24,7 +24,7 @@ def live_stage(tmp_dir, scm, dvc):
|
||||
|
||||
pytest.skip("dvclive does not exist yet")
|
||||
|
||||
def make(summary=True, report=True):
|
||||
def make(summary=True, html=True):
|
||||
tmp_dir.gen("train.py", LIVE_SCRITP)
|
||||
tmp_dir.gen("params.yaml", "foo: 1")
|
||||
stage = dvc.run(
|
||||
@@ -34,7 +34,7 @@ def live_stage(tmp_dir, scm, dvc):
|
||||
name="live_stage",
|
||||
live="logs",
|
||||
live_no_summary=not summary,
|
||||
live_no_report=not report,
|
||||
live_no_html=not html,
|
||||
)
|
||||
|
||||
scm.add(["dvc.yaml", "dvc.lock", "train.py", "params.yaml"])
|
||||
@@ -55,7 +55,7 @@ def test_export_config_tmp(tmp_dir, dvc, mocker, summary, report):
|
||||
name="run_logger",
|
||||
live="logs",
|
||||
live_no_summary=not summary,
|
||||
live_no_report=not report,
|
||||
live_no_html=not report,
|
||||
)
|
||||
|
||||
assert run_spy.call_count == 1
|
||||
@@ -67,8 +67,8 @@ def test_export_config_tmp(tmp_dir, dvc, mocker, summary, report):
|
||||
assert "DVCLIVE_SUMMARY" in kwargs["env"]
|
||||
assert kwargs["env"]["DVCLIVE_SUMMARY"] == str(int(summary))
|
||||
|
||||
assert "DVCLIVE_REPORT" in kwargs["env"]
|
||||
assert kwargs["env"]["DVCLIVE_REPORT"] == str(int(report))
|
||||
assert "DVCLIVE_HTML" in kwargs["env"]
|
||||
assert kwargs["env"]["DVCLIVE_HTML"] == str(int(report))
|
||||
|
||||
|
||||
@pytest.mark.parametrize("summary", (True, False))
|
||||
@@ -125,11 +125,11 @@ def test_experiments_track_summary(tmp_dir, scm, dvc, live_stage):
|
||||
assert "logs.json" in res[baseline_rev][exp_rev]["metrics"].keys()
|
||||
|
||||
|
||||
@pytest.mark.parametrize("report", [True, False])
|
||||
def test_live_report(tmp_dir, dvc, live_stage, report):
|
||||
live_stage(report=report)
|
||||
@pytest.mark.parametrize("html", [True, False])
|
||||
def test_live_html(tmp_dir, dvc, live_stage, html):
|
||||
live_stage(html=html)
|
||||
|
||||
assert (tmp_dir / "logs.html").is_file() == report
|
||||
assert (tmp_dir / "logs.html").is_file() == html
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
|
||||
@@ -25,7 +25,7 @@ def test_run(mocker, dvc):
|
||||
"--live",
|
||||
"live",
|
||||
"--live-no-summary",
|
||||
"--live-no-report",
|
||||
"--live-no-html",
|
||||
"--file",
|
||||
"file",
|
||||
"--wdir",
|
||||
@@ -72,7 +72,7 @@ def test_run(mocker, dvc):
|
||||
params=["file:param1,param2", "param3"],
|
||||
live="live",
|
||||
live_no_summary=True,
|
||||
live_no_report=True,
|
||||
live_no_html=True,
|
||||
fname="file",
|
||||
wdir="wdir",
|
||||
no_exec=True,
|
||||
@@ -103,7 +103,7 @@ def test_run_args_from_cli(mocker, dvc):
|
||||
plots_no_cache=[],
|
||||
live=None,
|
||||
live_no_summary=False,
|
||||
live_no_report=False,
|
||||
live_no_html=False,
|
||||
outs_persist=[],
|
||||
outs_persist_no_cache=[],
|
||||
checkpoints=[],
|
||||
@@ -138,7 +138,7 @@ def test_run_args_with_spaces(mocker, dvc):
|
||||
plots_no_cache=[],
|
||||
live=None,
|
||||
live_no_summary=False,
|
||||
live_no_report=False,
|
||||
live_no_html=False,
|
||||
outs_persist=[],
|
||||
outs_persist_no_cache=[],
|
||||
checkpoints=[],
|
||||
|
||||
@@ -36,7 +36,7 @@ def test_stage_add(mocker, dvc, command, parsed_command):
|
||||
"--live",
|
||||
"live",
|
||||
"--live-no-summary",
|
||||
"--live-no-report",
|
||||
"--live-no-html",
|
||||
"--wdir",
|
||||
"wdir",
|
||||
"--force",
|
||||
@@ -76,7 +76,7 @@ def test_stage_add(mocker, dvc, command, parsed_command):
|
||||
"plots_no_cache": ["plots-no-cache"],
|
||||
"live": "live",
|
||||
"live_no_summary": True,
|
||||
"live_no_report": True,
|
||||
"live_no_html": True,
|
||||
"wdir": "wdir",
|
||||
"outs_persist": ["outs-persist"],
|
||||
"outs_persist_no_cache": ["outs-persist-no-cache"],
|
||||
|
||||
Reference in New Issue
Block a user