plots: shorten names in the legend (#8900)

* plots: shorten field names

* plots: handle missing field names

* plots: make compatible with py3.8

* plots: fix for missing data

* plots: add test for field shortening

* plots: strip separators regardless of os

* plots: don't shorten field name

* plots: drop test for shortening field name
This commit is contained in:
Dave Berenbaum
2023-02-24 17:26:16 +01:00
committed by GitHub
parent 96ac321dd5
commit 35b648bbcf
2 changed files with 50 additions and 2 deletions
+34
View File
@@ -379,6 +379,40 @@ def test_finding_lists(dictionary, expected_result):
},
id="multi_source_y_single_x",
),
pytest.param(
{
"dir/f": {"metric": [{"v": 1, "v2": 0.1}]},
"dir/f2": {"metric": [{"v": 1, "v2": 0.1}]},
},
{"y": {"dir/f": ["v2"], "dir/f2": ["v2"]}, "x": "v"},
[
{
"v": 1,
"v2": 0.1,
VERSION_FIELD: {
"revision": "r",
"filename": "f",
"field": "v2",
},
},
{
"v": 1,
"v2": 0.1,
VERSION_FIELD: {
"revision": "r",
"filename": "f2",
"field": "v2",
},
},
],
{
"x": "v",
"y": "v2",
"x_label": "v",
"y_label": "v2",
},
id="multi_file_y_same_prefix",
),
],
)
def test_convert(