scripts: Adopted Attr rework in plot.py/plotmpl.py

Unifying these complicated attr-assigning flags across all the scripts
is the main benefit of the new internal Attr system.

The only tricky bit is we need to somehow keep track of all input fields
in case % modifiers reference fields, when we could previously discard
non-data fields.

Tricky but doable.

Updated flags:

- -L/--label -> -L/--add-label
- --colors -> -C/--add-color
- --formats -> -F/--add-format
- --chars -> -*/--add-char/--chars
- --line-chars -> -_/--add-line-char/--line-chars

I've also tweaked Attr to accept glob matches when figuring out group
assignments. This is useful for matching slightly different, but
similarly named results in our benchmark scripts.

There's probably a clever way to do this by injecting new by fields with
csv.py, but just adding globbing is simpler and makes attr assignment
even more flexible.
This commit is contained in:
Christopher Haster
2025-02-20 05:08:55 -06:00
parent 8b04e35ea5
commit 86f3bad2a4
6 changed files with 802 additions and 397 deletions

View File

@ -897,11 +897,11 @@ def find_ids(runner, test_ids=[], **args):
if '*' in name:
test_ids__.extend(suite
for suite in expected_suite_perms.keys()
if fnmatch.fnmatch(suite, name))
if fnmatch.fnmatchcase(suite, name))
if not test_ids__:
test_ids__.extend(case_
for case_ in expected_case_perms.keys()
if fnmatch.fnmatch(case_, name))
if fnmatch.fnmatchcase(case_, name))
# literal suite
elif name in expected_suite_perms:
test_ids__.append(id)