From 406c138847fd8cf14c0b0f5a6a111e17250c4848 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Tue, 29 Mar 2022 11:15:29 +0200 Subject: add --export-pgf-unparam option (export raw observations for pgfplots) --- lib/cli.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/cli.py b/lib/cli.py index f988421..49cb1b7 100644 --- a/lib/cli.py +++ b/lib/cli.py @@ -164,12 +164,21 @@ def export_dot(model, dot_prefix): print(dot_model, file=f) +def export_pgf_unparam(model, pgf_prefix): + for name in model.names: + for attribute in model.attributes(name): + with open(f"{pgf_prefix}{name}-{attribute}.txt", "w") as f: + print("measurement value", file=f) + for i, value in enumerate(model.attr_by_name[name][attribute].data): + print(f"{i} {value}", file=f) + + def add_standard_arguments(parser): parser.add_argument( "--export-dot", metavar="PREFIX", type=str, - help="Export model and model quality to LaTeX {PREFIX}{name}-{attribute}.dot", + help="Export tree-based model to {PREFIX}{name}-{attribute}.dot", ) parser.add_argument( "--export-dref", @@ -177,6 +186,12 @@ def add_standard_arguments(parser): type=str, help="Export model and model quality to LaTeX dataref file", ) + parser.add_argument( + "--export-pgf-unparam", + metavar="PREFIX", + type=str, + help="Export raw (parameter-independent) observations in tikz-pgf-compatible format to {PREFIX}{name}-{attribute}.txt", + ) parser.add_argument( "--export-xv", metavar="FILE", -- cgit v1.2.3