mirror of https://github.com/m-labs/artiq.git
short_format: cover a few more numpy types correctly
This commit is contained in:
parent
9e681590cb
commit
0857cfdcb1
|
@ -58,9 +58,9 @@ def short_format(v):
|
||||||
if v is None:
|
if v is None:
|
||||||
return "None"
|
return "None"
|
||||||
t = type(v)
|
t = type(v)
|
||||||
if t is bool or np.issubdtype(t, int) or np.issubdtype(t, float):
|
if np.issubdtype(t, np.number) or np.issubdtype(t, np.bool_):
|
||||||
return str(v)
|
return str(v)
|
||||||
elif t is str:
|
elif np.issubdtype(t, np.unicode_):
|
||||||
return "\"" + elide(v, 50) + "\""
|
return "\"" + elide(v, 50) + "\""
|
||||||
else:
|
else:
|
||||||
r = t.__name__
|
r = t.__name__
|
||||||
|
|
Loading…
Reference in New Issue