diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2022-03-29 11:15:29 +0200 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2022-03-29 11:15:29 +0200 |
commit | 406c138847fd8cf14c0b0f5a6a111e17250c4848 (patch) | |
tree | 50af2ec663afc8091aace58c91c2b6f33e792883 /lib | |
parent | 7989d4fdace6e46f31ccb45f027ba91ae34bc8e8 (diff) |
add --export-pgf-unparam option (export raw observations for pgfplots)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/cli.py | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -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", @@ -178,6 +187,12 @@ def add_standard_arguments(parser): 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", type=str, |