Skip to content

Commit f194ac1

Browse files
committed
Tiny export tuning
1 parent ea2d47b commit f194ac1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

mpds_client/export_MPDS.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ def _gen_basename(cls):
3939

4040
@classmethod
4141
def _get_title(cls, term):
42-
return cls.human_names.get(term, term)
42+
return cls.human_names.get(term, term.capitalize())
4343

4444
@classmethod
45-
def save_plot(cls, data, columns, plottype, fmt='json'):
45+
def save_plot(cls, data, columns, plottype, fmt='json', **kwargs):
4646
"""
4747
Exports the data in the following formats for plotting:
4848
@@ -103,6 +103,9 @@ def save_plot(cls, data, columns, plottype, fmt='json'):
103103
plot["payload"]["meshes"][-1]["y"].append(row[pointers[1]])
104104
plot["payload"]["meshes"][-1]["z"].append(row[pointers[2]])
105105

106+
if kwargs:
107+
plot["payload"].update(kwargs)
108+
106109
else: raise RuntimeError("\r\nError: %s is an unknown plot type" % plottype)
107110

108111
f_export.write(json.dumps(plot, escape_forward_slashes=False, indent=4))

0 commit comments

Comments
 (0)