diff options
author | Daniel Friesel <daniel.friesel@uos.de> | 2021-03-08 14:20:42 +0100 |
---|---|---|
committer | Daniel Friesel <daniel.friesel@uos.de> | 2021-03-08 14:20:42 +0100 |
commit | 4f763f85e9f572b56e3465ccd47641c71cdb8bbf (patch) | |
tree | afe598fa0c21876047ef4d3517d1835084b48763 /bin/analyze-archive.py | |
parent | 3865ca8f08181fa18d14aa924a0a1388cd5f54ee (diff) |
add dataref export
Diffstat (limited to 'bin/analyze-archive.py')
-rwxr-xr-x | bin/analyze-archive.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/bin/analyze-archive.py b/bin/analyze-archive.py index a9ee5cf..e7027ed 100755 --- a/bin/analyze-archive.py +++ b/bin/analyze-archive.py @@ -500,6 +500,12 @@ if __name__ == "__main__": "Creates a JSON file for each state and transition.", ) parser.add_argument( + "--export-dref", + metavar="FILE", + type=str, + help="Export model and model quality to LaTeX dataref file", + ) + parser.add_argument( "--filter-param", metavar="<parameter name>=<parameter value>[,<parameter name>=<parameter value>...]", type=str, @@ -1078,6 +1084,19 @@ if __name__ == "__main__": extra_function=function, ) + if args.export_dref: + dref = raw_data.to_dref() + dref.update(model.to_dref(static_quality, lut_quality, analytic_quality)) + with open(args.export_dref, "w") as f: + for k, v in dref.items(): + if type(v) is not tuple: + v = (v, None) + if v[1] is None: + prefix = r"\drefset{" + else: + prefix = r"\drefset" + f"[unit={v[1]}]" + "{" + print(f"{prefix}{k}" + "}{" + str(v[0]) + "}", file=f) + if args.export_energymodel: if not pta: print( |