Work around a Numpy deprecation warning
This commit is contained in:
parent
5d9fc5500c
commit
3be904d158
|
@ -25,7 +25,11 @@ def layout_to_dtype(layout):
|
|||
atype = '<f' + str(int(ltype[5:]) // 8)
|
||||
else:
|
||||
raise ValueError("bad layout")
|
||||
return numpy.dtype([('timestamp', '<i8'), ('data', atype, lcount)])
|
||||
if lcount == 1:
|
||||
dtype = [('timestamp', '<i8'), ('data', atype)]
|
||||
else:
|
||||
dtype = [('timestamp', '<i8'), ('data', atype, lcount)]
|
||||
return numpy.dtype(dtype)
|
||||
|
||||
class NumpyClient(nilmdb.client.client.Client):
|
||||
"""Subclass of nilmdb.client.Client that adds additional methods for
|
||||
|
|
Loading…
Reference in New Issue
Block a user