lima2.client 3.0a0__tar.gz → 3.0a1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lima2_client-3.0a0/src/lima2_client.egg-info → lima2_client-3.0a1}/PKG-INFO +1 -1
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/client/client.py +14 -2
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/client/detector.py +22 -8
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/client/pipeline.py +262 -140
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/client/pipelines/legacy.py +4 -2
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/client/pipelines/smx.py +53 -10
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/client/pipelines/xpcs.py +20 -9
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/client/topology.py +9 -9
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/client/utils.py +23 -3
- lima2_client-3.0a1/src/lima2/master_file/generate.py +803 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1/src/lima2_client.egg-info}/PKG-INFO +1 -1
- lima2_client-3.0a0/src/lima2/master_file/generate.py +0 -247
- {lima2_client-3.0a0 → lima2_client-3.0a1}/LICENSE +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/README.md +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/pyproject.toml +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/setup.cfg +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/finite_state_machine/__init__.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/finite_state_machine/draw_state_diagram.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/finite_state_machine/examples/__init__.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/finite_state_machine/examples/async_github_pull_request.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/finite_state_machine/examples/async_turnstile.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/finite_state_machine/examples/boolean_field.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/finite_state_machine/examples/github_pull_request.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/finite_state_machine/examples/turnstile.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/finite_state_machine/exceptions.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/finite_state_machine/state_machine.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/client/__init__.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/client/convert.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/client/devencoded/__init__.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/client/devencoded/dense_frame.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/client/devencoded/exception.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/client/devencoded/smx_sparse_frame.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/client/devencoded/sparse_frame.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/client/devencoded/structured_array.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/client/pipelines/__init__.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/client/pipelines/failing.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/client/progress_counter.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/client/py.typed +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/client/shell.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/client/state_machine.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/server/__init__.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/server/control.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/server/receiver.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2/server/timer.py +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2_client.egg-info/SOURCES.txt +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2_client.egg-info/dependency_links.txt +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2_client.egg-info/entry_points.txt +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2_client.egg-info/requires.txt +0 -0
- {lima2_client-3.0a0 → lima2_client-3.0a1}/src/lima2_client.egg-info/top_level.txt +0 -0
|
@@ -157,6 +157,7 @@ class Client:
|
|
|
157
157
|
acq_params=acq_params,
|
|
158
158
|
proc_params=proc_params,
|
|
159
159
|
num_receivers=len(self.receivers),
|
|
160
|
+
topology_kind=self.topology_kind,
|
|
160
161
|
)
|
|
161
162
|
|
|
162
163
|
self.detector.prepare_acq(uuid, ctl, acq, proc)
|
|
@@ -176,7 +177,13 @@ class Client:
|
|
|
176
177
|
|
|
177
178
|
@docstring_from(Detector.start_acq)
|
|
178
179
|
def start_acq(self) -> None:
|
|
179
|
-
self.
|
|
180
|
+
pipeline = self.current_pipeline
|
|
181
|
+
pipeline.register_on_finished(pipeline.unregister_events)
|
|
182
|
+
try:
|
|
183
|
+
self.detector.start_acq()
|
|
184
|
+
except Exception:
|
|
185
|
+
pipeline.unregister_events()
|
|
186
|
+
raise
|
|
180
187
|
|
|
181
188
|
@docstring_from(Detector.trigger)
|
|
182
189
|
def trigger(self) -> None:
|
|
@@ -293,9 +300,14 @@ class Client:
|
|
|
293
300
|
|
|
294
301
|
Raises if the pipeline is absent from a receiver.
|
|
295
302
|
"""
|
|
303
|
+
|
|
304
|
+
# First unregister Tango events
|
|
305
|
+
pipeline = self.__pipelines.pop(uuid, None)
|
|
306
|
+
if pipeline is not None:
|
|
307
|
+
pipeline.unregister_events()
|
|
308
|
+
|
|
296
309
|
for recv in self.receivers:
|
|
297
310
|
recv.erasePipeline(str(uuid))
|
|
298
|
-
self.__pipelines.pop(uuid, None)
|
|
299
311
|
|
|
300
312
|
def clear_previous_pipelines(self) -> None:
|
|
301
313
|
"""Erase all pipelines except the current one."""
|
|
@@ -24,6 +24,8 @@ import logging
|
|
|
24
24
|
import uuid
|
|
25
25
|
from collections.abc import Iterator
|
|
26
26
|
|
|
27
|
+
import gevent
|
|
28
|
+
|
|
27
29
|
import tango
|
|
28
30
|
from beartype import beartype
|
|
29
31
|
from gevent.lock import BoundedSemaphore
|
|
@@ -406,12 +408,18 @@ class Detector:
|
|
|
406
408
|
f"prepare_acq({uuid}, {ctrl_params}, {acq_params}, {proc_params})"
|
|
407
409
|
)
|
|
408
410
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
411
|
+
def parallel_exec(ctrl_fn, recv_fn):
|
|
412
|
+
tasks = [gevent.spawn(ctrl_fn, self.__ctrl)]
|
|
413
|
+
tasks += [gevent.spawn(recv_fn, i, r) for i, r in enumerate(self.__recvs)]
|
|
414
|
+
gevent.joinall(tasks, raise_error=True)
|
|
415
|
+
|
|
416
|
+
def validate_ctrl(ctrl):
|
|
417
|
+
validate(
|
|
418
|
+
instance=ctrl_params,
|
|
419
|
+
schema=self.params_schema[ctrl.name()]["acq_params"],
|
|
420
|
+
)
|
|
413
421
|
|
|
414
|
-
|
|
422
|
+
def validate_recv(i, recv):
|
|
415
423
|
validate(
|
|
416
424
|
instance=acq_params[i],
|
|
417
425
|
schema=self.params_schema[recv.name()]["acq_params"],
|
|
@@ -420,13 +428,19 @@ class Detector:
|
|
|
420
428
|
pipeline_class = pipelines.get_class(proc_params[i]["class_name"])
|
|
421
429
|
validate(instance=proc_params[i], schema=pipeline_class.params_schema)
|
|
422
430
|
|
|
431
|
+
parallel_exec(validate_ctrl, validate_recv)
|
|
432
|
+
|
|
423
433
|
# Update parameters on the device servers
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
434
|
+
def update_ctrl(ctrl):
|
|
435
|
+
# TODO: Rename acq_params to ctrl_params
|
|
436
|
+
ctrl.acq_params = json.dumps(ctrl_params)
|
|
437
|
+
|
|
438
|
+
def update_recv(i, recv):
|
|
427
439
|
recv.acq_params = json.dumps(acq_params[i])
|
|
428
440
|
recv.proc_params = json.dumps(proc_params[i])
|
|
429
441
|
|
|
442
|
+
parallel_exec(update_ctrl, update_recv)
|
|
443
|
+
|
|
430
444
|
# Raises and reverts to IDLE on exception
|
|
431
445
|
with self._locked_fsm() as fsm:
|
|
432
446
|
fsm.prepare(str(uuid))
|