import numpy as np
# plain (one level) blob showing different tango data types
# (explicity and implicit):
PIPE0 = \
('BlobCase0',
({'name': 'DE1', 'value': 123,}, # converts to DevLong64
{'name': 'DE2', 'value': np.int32(456),}, # converts to DevLong
{'name': 'DE3', 'value': 789, 'dtype': 'int32'}, # converts to DevLong
{'name': 'DE4', 'value': np.uint32(123)}, # converts to DevULong
{'name': 'DE5', 'value': range(5), 'dtype': ('uint16',)}, # converts to DevVarUShortArray
{'name': 'DE6', 'value': [1.11, 2.22], 'dtype': ('float64',)}, # converts to DevVarDoubleArray
{'name': 'DE7', 'value': numpy.zeros((100,))}, # converts to DevVarDoubleArray
{'name': 'DE8', 'value': True}, # converts to DevBoolean
)
)
# similar as above but in compact version (implicit data type conversion):
PIPE1 = \
('BlobCase1', dict(DE1=123, DE2=np.int32(456), DE3=np.int32(789),
DE4=np.uint32(123), DE5=np.arange(5, dtype='uint16'),
DE6=[1.11, 2.22], DE7=numpy.zeros((100,)),
DE8=True)
)
# similar as above but order matters so we use an ordered dict:
import collections
data = collections.OrderedDict()
data['DE1'] = 123
data['DE2'] = np.int32(456)
data['DE3'] = np.int32(789)
data['DE4'] = np.uint32(123)
data['DE5'] = np.arange(5, dtype='uint16')
data['DE6'] = [1.11, 2.22]
data['DE7'] = numpy.zeros((100,))
data['DE8'] = True
PIPE2 = 'BlobCase2', data
# another plain blob showing string, string array and encoded data types:
PIPE3 = \
('BlobCase3',
({'name': 'stringDE', 'value': 'Hello'},
{'name': 'VectorStringDE', 'value': ('bonjour', 'le', 'monde')},
{'name': 'DevEncodedDE', 'value': ('json', '"isn\'t it?"'), 'dtype': 'bytes'},
)
)
# blob with sub-blob which in turn has a sub-blob
PIPE4 = \
('BlobCase4',
({'name': '1DE', 'value': ('Inner', ({'name': '1_1DE', 'value': 'Grenoble'},
{'name': '1_2DE', 'value': ('InnerInner',
({'name': '1_1_1DE', 'value': np.int32(111)},
{'name': '1_1_2DE', 'value': [3.33]}))
})
)},
{'name': '2DE', 'value': (3,4,5,6), 'dtype': ('int32',) },
)
)