Commit 61e9ed8a authored by Wout De Nolf's avatar Wout De Nolf
Browse files

[writer] blindly accept group scan positioners from acquisition chain

parent a5e2f76f
Pipeline #29737 passed with stages
in 107 minutes and 49 seconds
......@@ -317,7 +317,7 @@ def _extract_device_info(
device = update_device(subdevices, fullname, data_info=data_info)
if key == "scalars":
if master:
if len(lst) > 1 and ndim <= 1:
if len(lst) > 1 and ndim <= 1 and ":" in fullname:
device["device_type"] = "positionergroup"
device["master_index"] = 0
else:
......
......@@ -401,13 +401,6 @@ class NexusScanWriterBase(base_subscriber.BaseSubscriber):
device = devices.update_device(subdevices, fullname)
if not device["device_type"]:
device["device_type"] = self._device_type(node)
if self.is_scan_group and device["device_type"] in (
"positioner",
"positionergroup",
):
device["device_type"] = "groupinfo"
if device["data_name"] == "value":
device["data_name"] = "data"
return device
def _device_type(self, node):
......
......@@ -49,21 +49,22 @@ def _test_nxw_scangroup(session=None, tmpdir=None, writer=None, **kwargs):
seq = Sequence()
seq.add_custom_channel(AcquisitionChannel("customdata", numpy.float, ()))
seq.add_custom_channel(AcquisitionChannel("diode34", numpy.float, ()))
with seq.sequence_context() as scan_seq:
scan1 = scans.loopscan(npoints, .1, detector1, run=False)
scan2 = scans.ascan(motor, 0, 1, npoints - 1, .1, detector2, run=False)
g1 = nxw_test_utils.run_scan(scan1, runasync=True)
seq.custom_channels["customdata"].emit(numpy.arange(npoints // 2))
g2 = nxw_test_utils.run_scan(scan2, runasync=True)
seq.custom_channels["customdata"].emit(numpy.arange(npoints // 2, npoints))
gevent.joinall([g1, g2])
diode34 = scan1.get_data()["diode3"] + scan2.get_data()["diode4"]
seq.custom_channels["diode34"].emit(diode34)
scan_seq.add(scan1)
scan_seq.add(scan2)
scan_grp = Group(scan1, scan2)
scan_seq.wait_all_subscans(timeout=10)
scan_grp.wait_all_subscans(timeout=10)
with gevent.Timeout(30):
with seq.sequence_context() as scan_seq:
scan1 = scans.loopscan(npoints, .1, detector1, run=False)
scan2 = scans.ascan(motor, 0, 1, npoints - 1, .1, detector2, run=False)
g1 = nxw_test_utils.run_scan(scan1, runasync=True)
seq.custom_channels["customdata"].emit(numpy.arange(npoints // 2))
g2 = nxw_test_utils.run_scan(scan2, runasync=True)
seq.custom_channels["customdata"].emit(numpy.arange(npoints // 2, npoints))
gevent.joinall([g1, g2])
diode34 = scan1.get_data()["diode3"] + scan2.get_data()["diode4"]
seq.custom_channels["diode34"].emit(diode34)
scan_seq.add(scan1)
scan_seq.add(scan2)
scan_grp = Group(scan1, scan2)
scan_seq.wait_all_subscans()
scan_grp.wait_all_subscans()
nxw_test_utils.wait_scan_data_finished(
[scan1, scan2, scan_seq.sequence.scan, scan_grp.scan], writer=writer
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment