summaryrefslogtreecommitdiff
path: root/lib/cli.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cli.py')
-rw-r--r--lib/cli.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/cli.py b/lib/cli.py
index 310314b..297944b 100644
--- a/lib/cli.py
+++ b/lib/cli.py
@@ -358,13 +358,13 @@ def export_dot(model, dot_prefix):
logger.info(f"Dot export of model saved to {filename}")
-def export_csv_unparam(model, csv_prefix):
+def export_csv_unparam(model, csv_prefix, dialect="excel"):
import csv
for name in sorted(model.names):
filename = f"{csv_prefix}{name}.csv"
with open(filename, "w") as f:
- writer = csv.writer(f)
+ writer = csv.writer(f, dialect=dialect)
writer.writerow(
["measurement"] + model.parameters + sorted(model.attributes(name))
)
@@ -479,6 +479,14 @@ def add_standard_arguments(parser):
help="Export raw (parameter-independent) observations in CSV format to {PREFIX}{name}-{attribute}.csv",
)
parser.add_argument(
+ "--export-csv-dialect",
+ metavar="DIALECT",
+ type=str,
+ choices=["excel", "excel-tab", "unix"],
+ default="excel",
+ help="CSV dialect to use for --export-csv-unparam",
+ )
+ parser.add_argument(
"--export-pgf-unparam",
metavar="PREFIX",
type=str,