From 0857cfdcb11a08ec49dc50e6de299905e0bd73ea Mon Sep 17 00:00:00 2001 From: Robert Jordens Date: Sat, 21 May 2016 20:11:08 +0200 Subject: [PATCH] short_format: cover a few more numpy types correctly --- artiq/tools.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artiq/tools.py b/artiq/tools.py index ef666cabf..20ef7e892 100644 --- a/artiq/tools.py +++ b/artiq/tools.py @@ -58,9 +58,9 @@ def short_format(v): if v is None: return "None" 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) - elif t is str: + elif np.issubdtype(t, np.unicode_): return "\"" + elide(v, 50) + "\"" else: r = t.__name__