forked from M-Labs/artiq
tools: add trim argument to format funcs
This commit is contained in:
parent
a384df17a4
commit
361088ae72
|
@ -72,6 +72,7 @@ def short_format(v, metadata={}):
|
||||||
v_t = np.divide(v, scale)
|
v_t = np.divide(v, scale)
|
||||||
v_str = np.format_float_positional(v_t,
|
v_str = np.format_float_positional(v_t,
|
||||||
precision=precision,
|
precision=precision,
|
||||||
|
trim='-',
|
||||||
unique=True)
|
unique=True)
|
||||||
v_str += " " + unit if unit else ""
|
v_str += " " + unit if unit else ""
|
||||||
return v_str
|
return v_str
|
||||||
|
@ -84,6 +85,7 @@ def short_format(v, metadata={}):
|
||||||
v_str = np.array2string(v_t,
|
v_str = np.array2string(v_t,
|
||||||
max_line_width=1000,
|
max_line_width=1000,
|
||||||
precision=precision,
|
precision=precision,
|
||||||
|
trim='-',
|
||||||
suppress_small=True,
|
suppress_small=True,
|
||||||
separator=', ',
|
separator=', ',
|
||||||
threshold=4,
|
threshold=4,
|
||||||
|
|
Loading…
Reference in New Issue