lima2.client 2.1.2__tar.gz → 2.2.0__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-2.1.2/src/lima2.client.egg-info → lima2_client-2.2.0}/PKG-INFO +1 -1
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/client/client.py +6 -2
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/client/detector.py +1 -3
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/client/pipeline.py +1 -3
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/client/pipelines/legacy.py +1 -1
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/client/pipelines/smx.py +1 -1
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/client/pipelines/xpcs.py +1 -1
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/client/state_machine.py +2 -2
- {lima2_client-2.1.2 → lima2_client-2.2.0/src/lima2.client.egg-info}/PKG-INFO +1 -1
- {lima2_client-2.1.2 → lima2_client-2.2.0}/tests/test_pipeline.py +21 -1
- {lima2_client-2.1.2 → lima2_client-2.2.0}/LICENSE +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/README.md +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/pyproject.toml +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/setup.cfg +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/client/__init__.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/client/convert.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/client/devencoded/__init__.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/client/devencoded/dense_frame.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/client/devencoded/exception.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/client/devencoded/smx_sparse_frame.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/client/devencoded/sparse_frame.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/client/devencoded/structured_array.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/client/pipelines/__init__.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/client/progress_counter.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/client/py.typed +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/client/shell.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/client/topology.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/client/utils.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/master_file/generate.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/server/__init__.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/server/control.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/server/receiver.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2/server/timer.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2.client.egg-info/SOURCES.txt +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2.client.egg-info/dependency_links.txt +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2.client.egg-info/entry_points.txt +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2.client.egg-info/requires.txt +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/src/lima2.client.egg-info/top_level.txt +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/tests/test_client.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/tests/test_convert.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/tests/test_dense_frame.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/tests/test_detector.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/tests/test_pipelines.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/tests/test_progress_counter.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/tests/test_sparse_frame.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/tests/test_state_machine.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/tests/test_timer.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/tests/test_topology.py +0 -0
- {lima2_client-2.1.2 → lima2_client-2.2.0}/tests/test_utils.py +0 -0
|
@@ -47,6 +47,7 @@ class Client:
|
|
|
47
47
|
self,
|
|
48
48
|
ctl_dev: tg.DeviceProxy,
|
|
49
49
|
rcv_devs: list[tg.DeviceProxy],
|
|
50
|
+
tango_timeout_s: int = 10,
|
|
50
51
|
):
|
|
51
52
|
"""Construct a Client given tango device proxies.
|
|
52
53
|
|
|
@@ -54,7 +55,8 @@ class Client:
|
|
|
54
55
|
The topology is queried from the control device properties.
|
|
55
56
|
"""
|
|
56
57
|
|
|
57
|
-
self._detector = Detector(ctl_dev, *rcv_devs)
|
|
58
|
+
self._detector = Detector(ctl_dev, *rcv_devs, timeout=tango_timeout_s)
|
|
59
|
+
self._tango_timeout = tango_timeout_s
|
|
58
60
|
|
|
59
61
|
try:
|
|
60
62
|
# Get the topology property from control
|
|
@@ -245,7 +247,9 @@ class Client:
|
|
|
245
247
|
proc_devs = [tg.DeviceProxy(url) for url in sorted(list(instances))]
|
|
246
248
|
|
|
247
249
|
# Instantiate pipeline
|
|
248
|
-
self.__pipelines[uuid] = pipeline_class(
|
|
250
|
+
self.__pipelines[uuid] = pipeline_class(
|
|
251
|
+
uuid, proc_devs, self.topology_kind, timeout=self._tango_timeout
|
|
252
|
+
)
|
|
249
253
|
|
|
250
254
|
return self.__pipelines[uuid]
|
|
251
255
|
|
|
@@ -47,13 +47,11 @@ class CommError(RuntimeError):
|
|
|
47
47
|
class Detector:
|
|
48
48
|
"""The main Detector interface."""
|
|
49
49
|
|
|
50
|
-
DEFAULT_TANGO_TIMEOUT = 5
|
|
51
|
-
|
|
52
50
|
def __init__(
|
|
53
51
|
self,
|
|
54
52
|
ctrl_dev: tango.DeviceProxy,
|
|
55
53
|
*recv_devs: tango.DeviceProxy,
|
|
56
|
-
timeout: int
|
|
54
|
+
timeout: int,
|
|
57
55
|
):
|
|
58
56
|
"""Construct a Detector object.
|
|
59
57
|
|
|
@@ -91,8 +91,6 @@ class Pipeline:
|
|
|
91
91
|
Definition in child classes is enforced by __init_subclass__().
|
|
92
92
|
"""
|
|
93
93
|
|
|
94
|
-
DEFAULT_TANGO_TIMEOUT = 20 * 60 #
|
|
95
|
-
|
|
96
94
|
BYPRODUCT_CACHE_LIMIT = 500
|
|
97
95
|
"""Maximum number of cached entries for each processing by-product.
|
|
98
96
|
|
|
@@ -167,7 +165,7 @@ class Pipeline:
|
|
|
167
165
|
uuid: UUID,
|
|
168
166
|
proc_devs: list[tango.DeviceProxy],
|
|
169
167
|
topology_kind: TopologyKind,
|
|
170
|
-
timeout: int
|
|
168
|
+
timeout: int,
|
|
171
169
|
):
|
|
172
170
|
"""Construct a Pipeline object.
|
|
173
171
|
|
|
@@ -43,7 +43,7 @@ class Legacy(Pipeline):
|
|
|
43
43
|
uuid: UUID,
|
|
44
44
|
proc_devs: list[tango.DeviceProxy],
|
|
45
45
|
topology_kind: TopologyKind,
|
|
46
|
-
timeout: int
|
|
46
|
+
timeout: int,
|
|
47
47
|
):
|
|
48
48
|
super().__init__(
|
|
49
49
|
uuid=uuid, proc_devs=proc_devs, topology_kind=topology_kind, timeout=timeout
|
|
@@ -57,7 +57,7 @@ class Smx(Pipeline):
|
|
|
57
57
|
uuid: UUID,
|
|
58
58
|
proc_devs: list[tango.DeviceProxy],
|
|
59
59
|
topology_kind: TopologyKind,
|
|
60
|
-
timeout: int
|
|
60
|
+
timeout: int,
|
|
61
61
|
):
|
|
62
62
|
super().__init__(
|
|
63
63
|
uuid=uuid, proc_devs=proc_devs, topology_kind=topology_kind, timeout=timeout
|
|
@@ -49,7 +49,7 @@ class Xpcs(Pipeline):
|
|
|
49
49
|
uuid: UUID,
|
|
50
50
|
proc_devs: list[tango.DeviceProxy],
|
|
51
51
|
topology_kind: TopologyKind,
|
|
52
|
-
timeout: int
|
|
52
|
+
timeout: int,
|
|
53
53
|
):
|
|
54
54
|
super().__init__(
|
|
55
55
|
uuid=uuid, proc_devs=proc_devs, topology_kind=topology_kind, timeout=timeout
|
|
@@ -86,7 +86,7 @@ class StateMachine(fsm.StateMachine):
|
|
|
86
86
|
_logger.error(
|
|
87
87
|
f"Device {evt.device.dev_name()} in FAULT state. Stopping all devices."
|
|
88
88
|
)
|
|
89
|
-
self.abort()
|
|
89
|
+
gevent.spawn(self.abort).join()
|
|
90
90
|
|
|
91
91
|
if self.state == State.DISCONNECTED:
|
|
92
92
|
_logger.info(
|
|
@@ -158,7 +158,7 @@ class StateMachine(fsm.StateMachine):
|
|
|
158
158
|
self.on_state_change(value)
|
|
159
159
|
|
|
160
160
|
@transition(
|
|
161
|
-
source=[State.IDLE, State.PREPARED
|
|
161
|
+
source=[State.IDLE, State.PREPARED],
|
|
162
162
|
target=State.PREPARING,
|
|
163
163
|
on_error=State.IDLE,
|
|
164
164
|
)
|
|
@@ -69,7 +69,12 @@ def processing_devices():
|
|
|
69
69
|
def test_constructor_no_devices():
|
|
70
70
|
"""Construct a Pipeline object with no processing devices."""
|
|
71
71
|
with pytest.raises(ValueError):
|
|
72
|
-
_ = Pipeline(
|
|
72
|
+
_ = Pipeline(
|
|
73
|
+
uuid=uuid1(),
|
|
74
|
+
proc_devs=[],
|
|
75
|
+
topology_kind=TopologyKind.ROUND_ROBIN,
|
|
76
|
+
timeout=10,
|
|
77
|
+
)
|
|
73
78
|
|
|
74
79
|
|
|
75
80
|
def test_constructor_single(processing_devices):
|
|
@@ -78,6 +83,7 @@ def test_constructor_single(processing_devices):
|
|
|
78
83
|
uuid=uuid1(),
|
|
79
84
|
proc_devs=processing_devices[:1],
|
|
80
85
|
topology_kind=TopologyKind.SINGLE,
|
|
86
|
+
timeout=10,
|
|
81
87
|
)
|
|
82
88
|
|
|
83
89
|
|
|
@@ -87,6 +93,7 @@ def test_constructor_uneven(processing_devices):
|
|
|
87
93
|
uuid=uuid1(),
|
|
88
94
|
proc_devs=processing_devices[:1],
|
|
89
95
|
topology_kind=TopologyKind.UNEVEN,
|
|
96
|
+
timeout=10,
|
|
90
97
|
)
|
|
91
98
|
|
|
92
99
|
|
|
@@ -125,6 +132,7 @@ def test_progress_counters(processing_devices):
|
|
|
125
132
|
uuid=uuid1(),
|
|
126
133
|
proc_devs=processing_devices[:1],
|
|
127
134
|
topology_kind=TopologyKind.ROUND_ROBIN,
|
|
135
|
+
timeout=10,
|
|
128
136
|
)
|
|
129
137
|
|
|
130
138
|
pc = proc.progress_counters
|
|
@@ -143,6 +151,7 @@ def test_cache_byproduct_limit(processing_devices):
|
|
|
143
151
|
uuid=uuid1(),
|
|
144
152
|
proc_devs=processing_devices,
|
|
145
153
|
topology_kind=TopologyKind.ROUND_ROBIN,
|
|
154
|
+
timeout=10,
|
|
146
155
|
)
|
|
147
156
|
|
|
148
157
|
# Force the pipeline to cache too many entries
|
|
@@ -178,6 +187,7 @@ def test_nb_roi_statistics(processing_devices):
|
|
|
178
187
|
uuid=uuid1(),
|
|
179
188
|
proc_devs=processing_devices,
|
|
180
189
|
topology_kind=TopologyKind.ROUND_ROBIN,
|
|
190
|
+
timeout=10,
|
|
181
191
|
)
|
|
182
192
|
|
|
183
193
|
assert proc.nb_roi_statistics.counters == [
|
|
@@ -199,6 +209,7 @@ def test_nb_roi_profiles(processing_devices):
|
|
|
199
209
|
uuid=uuid1(),
|
|
200
210
|
proc_devs=processing_devices,
|
|
201
211
|
topology_kind=TopologyKind.ROUND_ROBIN,
|
|
212
|
+
timeout=10,
|
|
202
213
|
)
|
|
203
214
|
|
|
204
215
|
assert proc.nb_roi_profiles.counters == [
|
|
@@ -224,6 +235,7 @@ def test_pop_roi_statistics_empty(processing_devices):
|
|
|
224
235
|
uuid=uuid1(),
|
|
225
236
|
proc_devs=processing_devices,
|
|
226
237
|
topology_kind=TopologyKind.ROUND_ROBIN,
|
|
238
|
+
timeout=10,
|
|
227
239
|
)
|
|
228
240
|
|
|
229
241
|
assert proc.pop_roi_statistics() == []
|
|
@@ -270,6 +282,7 @@ def test_pop_roi_statistics(processing_devices):
|
|
|
270
282
|
uuid=uuid1(),
|
|
271
283
|
proc_devs=processing_devices,
|
|
272
284
|
topology_kind=TopologyKind.ROUND_ROBIN,
|
|
285
|
+
timeout=10,
|
|
273
286
|
)
|
|
274
287
|
|
|
275
288
|
# First pop -> receiver 0 is ahead by 2 frames
|
|
@@ -330,6 +343,7 @@ def test_pop_roi_profiles_empty(processing_devices):
|
|
|
330
343
|
uuid=uuid1(),
|
|
331
344
|
proc_devs=processing_devices,
|
|
332
345
|
topology_kind=TopologyKind.ROUND_ROBIN,
|
|
346
|
+
timeout=10,
|
|
333
347
|
)
|
|
334
348
|
|
|
335
349
|
assert proc.pop_roi_profiles(roi_lengths=roi_lengths) == []
|
|
@@ -371,6 +385,7 @@ def test_pop_roi_profiles(processing_devices):
|
|
|
371
385
|
uuid=uuid1(),
|
|
372
386
|
proc_devs=processing_devices,
|
|
373
387
|
topology_kind=TopologyKind.ROUND_ROBIN,
|
|
388
|
+
timeout=10,
|
|
374
389
|
)
|
|
375
390
|
|
|
376
391
|
# First pop -> 3 frames available
|
|
@@ -406,6 +421,7 @@ def test_get_frame(processing_devices, monkeypatch):
|
|
|
406
421
|
uuid=uuid1(),
|
|
407
422
|
proc_devs=processing_devices,
|
|
408
423
|
topology_kind=TopologyKind.ROUND_ROBIN,
|
|
424
|
+
timeout=10,
|
|
409
425
|
)
|
|
410
426
|
|
|
411
427
|
@dataclass
|
|
@@ -498,6 +514,7 @@ def test_smx_peak_counters(processing_devices):
|
|
|
498
514
|
uuid=uuid1(),
|
|
499
515
|
proc_devs=processing_devices,
|
|
500
516
|
topology_kind=TopologyKind.ROUND_ROBIN,
|
|
517
|
+
timeout=10,
|
|
501
518
|
)
|
|
502
519
|
|
|
503
520
|
# Receiver 0 yields 3 frames, versus 1 frame for receiver 1.
|
|
@@ -524,6 +541,7 @@ def test_xpcs_fill_factors(processing_devices):
|
|
|
524
541
|
uuid=uuid1(),
|
|
525
542
|
proc_devs=processing_devices,
|
|
526
543
|
topology_kind=TopologyKind.ROUND_ROBIN,
|
|
544
|
+
timeout=10,
|
|
527
545
|
)
|
|
528
546
|
|
|
529
547
|
# Receiver 1 yields 3 frames, versus 1 frame for receiver 0.
|
|
@@ -595,6 +613,7 @@ def test_register_on_finished(processing_devices, event_man):
|
|
|
595
613
|
uuid=uuid1(),
|
|
596
614
|
proc_devs=processing_devices,
|
|
597
615
|
topology_kind=TopologyKind.ROUND_ROBIN,
|
|
616
|
+
timeout=10,
|
|
598
617
|
)
|
|
599
618
|
|
|
600
619
|
# Flag for pipelines on all receivers finished
|
|
@@ -641,6 +660,7 @@ def test_register_on_error(processing_devices, event_man):
|
|
|
641
660
|
uuid=uuid1(),
|
|
642
661
|
proc_devs=processing_devices,
|
|
643
662
|
topology_kind=TopologyKind.ROUND_ROBIN,
|
|
663
|
+
timeout=10,
|
|
644
664
|
)
|
|
645
665
|
|
|
646
666
|
errored_devices = set()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|