summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2022-03-31 18:39:42 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2022-03-31 18:39:42 +0200
commita50b3864452e72d01f5fe9a7c4a8d0f825b661b4 (patch)
treea76d767200cc55b5e3fcde230e06c949a631f22c /lib
parent58616f7177ffc6a1db7689f727688518ce07ad5c (diff)
--export-pgf-unparam: add parameter values (e.g. for `restrict expr to domain`)
Diffstat (limited to 'lib')
-rw-r--r--lib/cli.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/cli.py b/lib/cli.py
index 49cb1b7..978f6e7 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -168,9 +168,16 @@ 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)
+ print("measurement value " + " ".join(model.parameters), file=f)
for i, value in enumerate(model.attr_by_name[name][attribute].data):
- print(f"{i} {value}", file=f)
+ parameters = list()
+ for param in model.attr_by_name[name][attribute].param_values[i]:
+ if param is None:
+ parameters.append("{}")
+ else:
+ parameters.append(str(param))
+ parameters = " ".join(parameters)
+ print(f"{i} {value} {parameters}", file=f)
def add_standard_arguments(parser):