Open mrakitin opened 1 year ago
This looks like a broken enum...
In [2]: det.read_configuration()
Out[2]:
OrderedDict([('det_Imax', {'value': 1, 'timestamp': 1670611553.7255466}),
('det_center', {'value': 0, 'timestamp': 1670611553.725544}),
('det_sigma', {'value': 1, 'timestamp': 1670611553.725551}),
('det_noise', {'value': 'none', 'timestamp': 1670611553.7255316}),
('det_noise_multiplier',
{'value': 1, 'timestamp': 1670611553.7255402})])
In [3]: det.describe_configuration()
Out[3]:
OrderedDict([('det_Imax',
{'source': 'SIM:det_Imax', 'dtype': 'integer', 'shape': []}),
('det_center',
{'source': 'SIM:det_center', 'dtype': 'integer', 'shape': []}),
('det_sigma',
{'source': 'SIM:det_sigma', 'dtype': 'integer', 'shape': []}),
('det_noise',
{'source': 'SIM:det_noise',
'dtype': 'integer',
'shape': [],
'enum_strs': ('none', 'poisson', 'uniform')}),
('det_noise_multiplier',
{'source': 'SIM:det_noise_multiplier',
'dtype': 'integer',
'shape': []})])
which says there is something wrong with the EnumSignal
:
In [6]: es = EnumSignal(value='a', enum_strings=['a', 'b', 'c'], name='bob')
In [7]: es.read()
Out[7]: {'bob': {'value': 'a', 'timestamp': 1670611752.3272095}}
In [8]: es.describe()
Out[8]:
{'bob': {'source': 'SIM:bob',
'dtype': 'integer',
'shape': [],
'enum_strs': ('a', 'b', 'c')}}
While testing bluesky/databroker#750, we discovered that the simulated detector (
ophyd.sim.det
) does not work well with databroker v2.Error
Here is the error while reading the recorded configuration (expand it):
Step to reproduce:
pip install databroker=2.0.0b13[all]
) and its dev dependencies.RE = RunEngine({}) db = temp() RE.subscribe(db.v1.insert) bec = BestEffortCallback() RE.subscribe(bec)
det.kind = 'hinted' motor.kind = 'hinted' motor.delay = 0.1
RE(bp.scan([det], motor, -1, 1, 3)) det.read_configuration() db[-1].primary.config['det'].read()