Pin a chart to the last few runs of a flow
This commit is contained in:
@@ -493,3 +493,24 @@ def test_a_flow_declaring_no_outputs_draws_no_stats():
|
||||
defn = results_dashboard(training_flow().model_copy(update={"outputs": []}))
|
||||
|
||||
assert [w.type for w in defn.widgets] == ["chart"]
|
||||
|
||||
|
||||
def runs_chart(**runs) -> WidgetDef:
|
||||
return WidgetDef(id="curves", type="chart", config={"source": "runs", "runs": runs})
|
||||
|
||||
|
||||
def test_a_chart_pinned_to_runs_reads_no_live_message():
|
||||
"""Its series is in the run tables; the engine has nothing to keep for it."""
|
||||
widget = runs_chart(metric="study.loss", flow="study", latest=3)
|
||||
|
||||
assert widget.messages == []
|
||||
assert widget.history_points == 0
|
||||
|
||||
|
||||
def test_a_chart_of_runs_must_say_which_runs_and_which_metric():
|
||||
with pytest.raises(ValueError, match="metric"):
|
||||
runs_chart(flow="study")
|
||||
with pytest.raises(ValueError, match="a flow, a sweep, or run ids"):
|
||||
runs_chart(metric="study.loss")
|
||||
with pytest.raises(ValueError, match="between 1 and 5"):
|
||||
runs_chart(metric="study.loss", flow="study", latest=9)
|
||||
|
||||
Reference in New Issue
Block a user