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 | |
parent | 7989d4fdace6e46f31ccb45f027ba91ae34bc8e8 (diff) |
add --export-pgf-unparam option (export raw observations for pgfplots)
-rwxr-xr-x | bin/analyze-archive.py | 3 | ||||
-rw-r--r-- | lib/cli.py | 17 |
2 files changed, 19 insertions, 1 deletions
diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py index 4aab326..1766424 100755 --- a/bin/analyze-archive.py +++ b/bin/analyze-archive.py @@ -639,6 +639,9 @@ if __name__ == "__main__": if args.info: dfatool.cli.print_info_by_name(model, by_name) + if args.export_pgf_unparam: + dfatool.cli.export_pgf_unparam(model, args.export_pgf_unparam) + if args.cross_validate: xv_method, xv_count = args.cross_validate.split(":") xv_count = int(xv_count) @@ -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, |